fix item order

This commit is contained in:
x2cf
2023-04-28 15:59:39 +08:00
committed by Nazar Kanaev
parent 9f1a0534a3
commit 32ca121520
3 changed files with 27 additions and 4 deletions

View File

@@ -76,7 +76,7 @@ func (s *Storage) CreateItems(items []Item) bool {
return false
}
now := time.Now()
now := time.Now().UTC()
for _, item := range items {
_, err = tx.Exec(`
@@ -85,7 +85,7 @@ func (s *Storage) CreateItems(items []Item) bool {
content, image, podcast_url,
date_arrived, status
)
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
values (?, ?, ?, ?, strftime('%Y-%m-%d %H:%M:%f', ?), ?, ?, ?, ?, ?)
on conflict (feed_id, guid) do nothing`,
item.GUID, item.FeedId, item.Title, item.Link, item.Date,
item.Content, item.ImageURL, item.AudioURL,
@@ -343,7 +343,7 @@ func (s *Storage) DeleteOldItems() {
feedId,
STARRED,
limit,
time.Now().Add(-time.Hour*time.Duration(24*itemsKeepDays)),
time.Now().UTC().Add(-time.Hour*time.Duration(24*itemsKeepDays)),
)
if err != nil {
log.Print(err)