Continue post-DatabaseResult simplification.

This commit is contained in:
Brent Simmons committed 2026-06-10 14:57:42 -07:00
1 parent 31d0b9d3e4
commit fcaa1cc03c
4 files changed
+8 -8

No files matched your search

@@ -866,8 +866,8 @@ public enum FetchType {
await database.fetchUnreadCountForStarredArticlesAsync(feedIDs: flattenedFeedsIDs)
}
public func fetchCountForStarredArticles() throws -> Int {
try database.fetchStarredArticlesCount(feedIDs: flattenedFeedsIDs)
public func fetchCountForStarredArticles() -> Int {
database.fetchStarredArticlesCount(feedIDs: flattenedFeedsIDs)
}
public func fetchArticleCountsAsync() async throws -> ArticleCounts {
@@ -440,7 +440,7 @@ import ActivityLog
precondition(Thread.isMainThread)
var count = 0
for account in activeAccounts {
count += try account.fetchCountForStarredArticles()
count += account.fetchCountForStarredArticles()
}
return count
}
@@ -138,9 +138,9 @@ public struct ArticleCounts: Sendable {
return articlesTable.fetchStarredArticles(feedIDs, limit)
}
public func fetchStarredArticlesCount(feedIDs: Set<String>) throws -> Int {
public func fetchStarredArticlesCount(feedIDs: Set<String>) -> Int {
Self.logger.debug("ArticlesDatabase: \(#function, privacy: .public) \(self.accountID, privacy: .public)")
return try articlesTable.fetchStarredArticlesCount(feedIDs)
return articlesTable.fetchStarredArticlesCount(feedIDs)
}
/// Returns aggregate article counts (total, unread, starred, statuses) for the given feeds.
@@ -104,8 +104,8 @@ final class ArticlesTable: DatabaseTable, Sendable {
fetchArticlesAsync({ self.fetchStarredArticles(feedIDs, limit, $0) }, completion)
}
func fetchStarredArticlesCount(_ feedIDs: Set<String>) throws -> Int {
return try fetchArticlesCount { self.fetchStarredArticlesCount(feedIDs, $0) }
func fetchStarredArticlesCount(_ feedIDs: Set<String>) -> Int {
fetchArticlesCount { self.fetchStarredArticlesCount(feedIDs, $0) }
}
// MARK: - Fetching Counts Async
@@ -634,7 +634,7 @@ nonisolated private extension ArticlesTable {
return articles
}
private func fetchArticlesCount(_ fetchMethod: @escaping ArticlesCountFetchMethod) throws -> Int {
private func fetchArticlesCount(_ fetchMethod: @escaping ArticlesCountFetchMethod) -> Int {
nonisolated(unsafe) var articlesCount = 0
queue.runInDatabaseSync { database in