ditched filtering

This commit is contained in:
Stuart Breckenridge 2020-11-19 20:41:05 +08:00
parent b34510eb5c
commit e8174d0070
No known key found for this signature in database
GPG Key ID: 1F11FD62007DC331
1 changed files with 2 additions and 2 deletions

View File

@ -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,