summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis van der Schagt <dennisschagt@gmail.com>2024-10-01 22:52:49 +0200
committerGitHub <noreply@github.com>2024-10-01 22:52:49 +0200
commitd7f62f90aa44a9795108a797e063280478cc9753 (patch)
treebfa22483ce9eaf9e2e9af6b74e60c73750a41739
parentd6a5a09e5d6778e7aa4c852c8c1f14274fb56aee (diff)
parent1f695928298e8492ceed75e8a5157ba66dc9effa (diff)
Merge pull request #2872 from dennisschagt/pubdate-before-1970
Store negative timestamps in database to support dates before 1970
-rw-r--r--src/cache.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cache.cpp b/src/cache.cpp
index 50724c05..1171cde6 100644
--- a/src/cache.cpp
+++ b/src/cache.cpp
@@ -931,6 +931,7 @@ void Cache::update_rssitem_unlocked(std::shared_ptr<RssItem> item,
}
run_sql(update);
} else {
+ std::int64_t pubTimestamp = item->pubDate_timestamp();
std::string insert = prepare_query(
"INSERT INTO rss_item (guid, title, author, url, "
"feedurl, "
@@ -938,13 +939,13 @@ void Cache::update_rssitem_unlocked(std::shared_ptr<RssItem> item,
"enclosure_type, enclosure_description, enclosure_description_mime_type, "
"enqueued, base) "
"VALUES "
- "('%q','%q','%q','%q','%q','%u','%q','%q','%d','%q','%q','%q','%q',%d, '%q')",
+ "('%q','%q','%q','%q','%q','%" PRId64 "','%q','%q','%d','%q','%q','%q','%q',%d, '%q')",
item->guid(),
item->title(),
item->author(),
item->link(),
feedurl,
- item->pubDate_timestamp(),
+ pubTimestamp,
description.text,
description.mime,
(item->unread() ? 1 : 0),