From e8174d0070787f964f224e62d61cacb8a6c2b888 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Thu, 19 Nov 2020 20:41:05 +0800 Subject: [PATCH] ditched filtering --- Shared/Widget/WidgetDataEncoder.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Shared/Widget/WidgetDataEncoder.swift b/Shared/Widget/WidgetDataEncoder.swift index 171afbf28..7a88f3b24 100644 --- a/Shared/Widget/WidgetDataEncoder.swift +++ b/Shared/Widget/WidgetDataEncoder.swift @@ -50,7 +50,7 @@ struct WidgetDataEncoder { } // Today Articles - let todayArticles = try SmartFeedsController.shared.todayFeed.fetchArticles().sorted(by: { $0.datePublished ?? .distantPast > $1.datePublished ?? .distantPast }).filter({ $0.status.read == false }) + let todayArticles = try SmartFeedsController.shared.todayFeed.fetchUnreadArticles().sorted(by: { $0.datePublished ?? .distantPast > $1.datePublished ?? .distantPast }) var today = [LatestArticle]() for article in todayArticles { let latestArticle = LatestArticle(id: article.sortableArticleID, @@ -64,7 +64,7 @@ struct WidgetDataEncoder { } let latestData = WidgetData(currentUnreadCount: SmartFeedsController.shared.unreadFeed.unreadCount, - currentTodayCount: try! SmartFeedsController.shared.todayFeed.fetchArticles().filter({ $0.status.read == false }).count, + currentTodayCount: try! SmartFeedsController.shared.todayFeed.fetchUnreadArticles().count, currentStarredCount: try! SmartFeedsController.shared.starredFeed.fetchArticles().count, unreadArticles: unread, starredArticles: starred,