aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-01-29 21:07:55 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-01-29 21:07:55 -0800
commitb0442e027771c2cf33b92557a7e73fa4f85849cf (patch)
tree0043274fc62eeaf12d29adc0e01462f8a03fbc66
parentbca717873e678dcbf2865087a22959475ee24fec (diff)
Do not update entry date while refreshing a feed
We do not update the published date because some feeds do not contains any date, in this case it default to time.Now(), which could change the order of items on the history page.
-rw-r--r--storage/entry.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/storage/entry.go b/storage/entry.go
index 5ff5f5c..7df88c3 100644
--- a/storage/entry.go
+++ b/storage/entry.go
@@ -76,19 +76,20 @@ func (s *Storage) UpdateEntryContent(entry *model.Entry) error {
return err
}
-// updateEntry update an entry when a feed is refreshed.
+// updateEntry updates an entry when a feed is refreshed.
+// Note: we do not update the published date because some feeds do not contains any date,
+// it default to time.Now() which could change the order of items on the history page.
func (s *Storage) updateEntry(entry *model.Entry) error {
query := `
UPDATE entries SET
- title=$1, url=$2, published_at=$3, content=$4, author=$5
- WHERE user_id=$6 AND feed_id=$7 AND hash=$8
+ title=$1, url=$2, content=$3, author=$4
+ WHERE user_id=$5 AND feed_id=$6 AND hash=$7
RETURNING id
`
err := s.db.QueryRow(
query,
entry.Title,
entry.URL,
- entry.Date,
entry.Content,
entry.Author,
entry.UserID,