From 9e3873b94e7ff1bea659d83ce3b12f630766a436 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 23 Feb 2021 11:40:27 +0200 Subject: Feeds: Secondary sort by discovery time IssueID #173 --- src/feeds.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/feeds.c b/src/feeds.c index 3fb05d14..c66b2b84 100644 --- a/src/feeds.c +++ b/src/feeds.c @@ -598,7 +598,10 @@ void removeEntries_Feeds(uint32_t feedBookmarkId) { static int cmpTimeDescending_FeedEntryPtr_(const void *a, const void *b) { const iFeedEntry * const *e1 = a, * const *e2 = b; - return -cmp_Time(&(*e1)->posted, &(*e2)->posted); + const int cmpPosted = -cmp_Time(&(*e1)->posted, &(*e2)->posted); + if (cmpPosted) return cmpPosted; + /* Posting timestamps may only be accurate to a day, so also sort by discovery time. */ + return -cmp_Time(&(*e1)->discovered, &(*e2)->discovered); } const iPtrArray *listEntries_Feeds(void) { -- cgit v1.2.3