summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-27 13:50:31 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-27 13:50:31 +0200
commit54f063e859f8e7eb5c3a825763ed4c85d30ef5b5 (patch)
tree988b317f336636645ee650f6a95e8933900c2bed
parent701c579186d403aefd49107be00dd38625c6e357 (diff)
Feeds: Fixed "about:feeds" when feeds never refreshed
-rw-r--r--src/feeds.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/feeds.c b/src/feeds.c
index 9468ba65..26d8c04f 100644
--- a/src/feeds.c
+++ b/src/feeds.c
@@ -500,16 +500,20 @@ const iString *entryListPage_Feeds(void) {
500 int elapsed = elapsedSeconds_Time(&d->lastRefreshedAt) / 60; 500 int elapsed = elapsedSeconds_Time(&d->lastRefreshedAt) / 60;
501 appendFormat_String( 501 appendFormat_String(
502 src, 502 src,
503 "You are subscribed to %zu feed%s that contain%s a total of %zu entries.\n\n" 503 "You are subscribed to %zu feed%s that contain%s a total of %zu entries.\n",
504 "The latest refresh occurred %s.\n",
505 size_PtrArray(subs), 504 size_PtrArray(subs),
506 iPluralS(size_PtrArray(subs)), 505 iPluralS(size_PtrArray(subs)),
507 size_PtrArray(subs) == 1 ? "s" : "", 506 size_PtrArray(subs) == 1 ? "s" : "",
508 size_SortedArray(&d->entries), 507 size_SortedArray(&d->entries));
509 elapsed == 0 ? "just a moment ago" 508 if (isValid_Time(&d->lastRefreshedAt)) {
510 : elapsed < 60 ? format_CStr("%d minute%s ago", elapsed, iPluralS(elapsed)) 509 appendFormat_String(src,
511 : elapsed < 1440 ? format_CStr("%d hour%s ago", elapsed / 60, iPluralS(elapsed / 60)) 510 "\nThe latest refresh occurred %s.\n",
512 : format_CStr("%d day%s ago", elapsed / 1440, iPluralS(elapsed / 1440))); 511 elapsed == 0 ? "just a moment ago"
512 : elapsed < 60 ? format_CStr("%d minute%s ago", elapsed, iPluralS(elapsed))
513 : elapsed < 1440 ? format_CStr("%d hour%s ago", elapsed / 60, iPluralS(elapsed / 60))
514 : format_CStr("%d day%s ago", elapsed / 1440,
515 iPluralS(elapsed / 1440)));
516 }
513 iDate on; 517 iDate on;
514 iZap(on); 518 iZap(on);
515 iConstForEach(PtrArray, i, listEntries_Feeds()) { 519 iConstForEach(PtrArray, i, listEntries_Feeds()) {