Просмотр исходного кода

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.
Frédéric Guillot 8 лет назад
Родитель
Сommit
b0442e0277
1 измененных файлов с 5 добавлено и 4 удалено
  1. 5 4
      storage/entry.go

+ 5 - 4
storage/entry.go

@@ -76,19 +76,20 @@ func (s *Storage) UpdateEntryContent(entry *model.Entry) error {
 	return err
 	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 {
 func (s *Storage) updateEntry(entry *model.Entry) error {
 	query := `
 	query := `
 		UPDATE entries SET
 		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
 		RETURNING id
 	`
 	`
 	err := s.db.QueryRow(
 	err := s.db.QueryRow(
 		query,
 		query,
 		entry.Title,
 		entry.Title,
 		entry.URL,
 		entry.URL,
-		entry.Date,
 		entry.Content,
 		entry.Content,
 		entry.Author,
 		entry.Author,
 		entry.UserID,
 		entry.UserID,