diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-23 11:40:27 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-23 11:40:27 +0200 |
commit | 9e3873b94e7ff1bea659d83ce3b12f630766a436 (patch) | |
tree | fb5ffa652fa1b3d419b176d41f1a666b9472ea2e /src | |
parent | c0df64db6c13a8880a0d204fedfd7841f813c255 (diff) |
Feeds: Secondary sort by discovery time
IssueID #173
Diffstat (limited to 'src')
-rw-r--r-- | src/feeds.c | 5 |
1 files changed, 4 insertions, 1 deletions
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) { | |||
598 | 598 | ||
599 | static int cmpTimeDescending_FeedEntryPtr_(const void *a, const void *b) { | 599 | static int cmpTimeDescending_FeedEntryPtr_(const void *a, const void *b) { |
600 | const iFeedEntry * const *e1 = a, * const *e2 = b; | 600 | const iFeedEntry * const *e1 = a, * const *e2 = b; |
601 | return -cmp_Time(&(*e1)->posted, &(*e2)->posted); | 601 | const int cmpPosted = -cmp_Time(&(*e1)->posted, &(*e2)->posted); |
602 | if (cmpPosted) return cmpPosted; | ||
603 | /* Posting timestamps may only be accurate to a day, so also sort by discovery time. */ | ||
604 | return -cmp_Time(&(*e1)->discovered, &(*e2)->discovered); | ||
602 | } | 605 | } |
603 | 606 | ||
604 | const iPtrArray *listEntries_Feeds(void) { | 607 | const iPtrArray *listEntries_Feeds(void) { |