mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Make insertStatuses take a Set.
This commit is contained in:
@@ -408,7 +408,7 @@ enum CloudKitAccountDelegateError: LocalizedError {
|
||||
SyncStatus(articleID: article.articleID, key: SyncStatus.Key(statusKey), flag: flag)
|
||||
}
|
||||
|
||||
try? await database.insertStatuses(syncStatuses)
|
||||
try? await database.insertStatuses(Set(syncStatuses))
|
||||
if let count = try? await self.database.selectPendingCount(), count > 100 {
|
||||
try await sendArticleStatus(for: account, showProgress: false)
|
||||
}
|
||||
@@ -671,7 +671,7 @@ private extension CloudKitAccountDelegate {
|
||||
return SyncStatus(articleID: article.articleID, key: statusKey, flag: flag)
|
||||
}
|
||||
|
||||
try? await database.insertStatuses(syncStatuses)
|
||||
try? await database.insertStatuses(Set(syncStatuses))
|
||||
}
|
||||
|
||||
func sendArticleStatus(for account: Account, showProgress: Bool) async throws {
|
||||
|
||||
@@ -124,7 +124,7 @@ private extension CloudKitArticlesZoneDelegate {
|
||||
}
|
||||
|
||||
let syncStatuses = deletes.map { SyncStatus(articleID: $0.articleID, key: .deleted, flag: true) }
|
||||
try? await self.database.insertStatuses(syncStatuses)
|
||||
try? await self.database.insertStatuses(Set(syncStatuses))
|
||||
|
||||
} catch {
|
||||
errorOccurred = true
|
||||
|
||||
@@ -378,7 +378,7 @@ public enum FeedbinAccountDelegateError: String, Error {
|
||||
return SyncStatus(articleID: article.articleID, key: SyncStatus.Key(statusKey), flag: flag)
|
||||
}
|
||||
|
||||
try? await database.insertStatuses(syncStatuses)
|
||||
try? await database.insertStatuses(Set(syncStatuses))
|
||||
|
||||
if let count = try? await database.selectPendingCount(), count > 100 {
|
||||
try? await sendArticleStatus(for: account)
|
||||
|
||||
@@ -357,7 +357,7 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
||||
return SyncStatus(articleID: article.articleID, key: SyncStatus.Key(statusKey), flag: flag)
|
||||
}
|
||||
|
||||
try? await syncDatabase.insertStatuses(syncStatuses)
|
||||
try? await syncDatabase.insertStatuses(Set(syncStatuses))
|
||||
|
||||
if let count = try? await syncDatabase.selectPendingCount(), count > 100 {
|
||||
try? await sendArticleStatus(for: account)
|
||||
|
||||
@@ -411,7 +411,7 @@ final class NewsBlurAccountDelegate: AccountDelegate {
|
||||
let syncStatuses = articles.map { article in
|
||||
return SyncStatus(articleID: article.articleID, key: SyncStatus.Key(statusKey), flag: flag)
|
||||
}
|
||||
try? await syncDatabase.insertStatuses(syncStatuses)
|
||||
try? await syncDatabase.insertStatuses(Set(syncStatuses))
|
||||
|
||||
if let count = try? await syncDatabase.selectPendingCount(), count > 100 {
|
||||
try await sendArticleStatus(for: account)
|
||||
|
||||
@@ -443,7 +443,7 @@ final class ReaderAPIAccountDelegate: AccountDelegate {
|
||||
return SyncStatus(articleID: article.articleID, key: SyncStatus.Key(statusKey), flag: flag)
|
||||
}
|
||||
|
||||
try await self.database.insertStatuses(syncStatuses)
|
||||
try await self.database.insertStatuses(Set(syncStatuses))
|
||||
|
||||
if let count = try await self.database.selectPendingCount(), count > 100 {
|
||||
try await sendArticleStatus(for: account)
|
||||
|
||||
Reference in New Issue
Block a user