Bring in code from previous iOS release.

This commit is contained in:
Brent Simmons
2024-12-04 16:43:36 -08:00
parent 2c945519ad
commit 7b38129792
2 changed files with 15 additions and 0 deletions

View File

@@ -699,6 +699,10 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
database.fetchStarredAndUnreadCount(for: flattenedWebFeeds().webFeedIDs(), completion: completion)
}
public func fetchCountForStarredArticles() throws -> Int {
return try database.fetchStarredArticlesCount(flattenedWebFeeds().webFeedIDs())
}
public func fetchUnreadArticleIDs(_ completion: @escaping ArticleIDsCompletionBlock) {
database.fetchUnreadArticleIDsAsync(completion: completion)
}

View File

@@ -405,6 +405,17 @@ public final class AccountManager: UnreadCountProvider {
}
}
// MARK: - Fetching Article Counts
public func fetchCountForStarredArticles() throws -> Int {
precondition(Thread.isMainThread)
var count = 0
for account in activeAccounts {
count += try account.fetchCountForStarredArticles()
}
return count
}
// MARK: - Caches
/// Empty caches that can reasonably be emptied  when the app moves to the background, for instance.