From b0442e027771c2cf33b92557a7e73fa4f85849cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Mon, 29 Jan 2018 21:07:55 -0800 Subject: [PATCH] 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. --- storage/entry.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/storage/entry.go b/storage/entry.go index 5ff5f5c8..7df88c3b 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,