From 758aa62f61e20e30b4b14b9818af5d7eeae7f153 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 26 Apr 2024 08:02:53 -0700 Subject: [PATCH] Create updateAccountFeedsWithItems which will replace FeedlyUpdateAccountFeedsWithItemsOperation. --- .../AccountDelegates/FeedlyAccountDelegate.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Account/Sources/Account/AccountDelegates/FeedlyAccountDelegate.swift b/Account/Sources/Account/AccountDelegates/FeedlyAccountDelegate.swift index 754a52e4e..bfe1ef777 100644 --- a/Account/Sources/Account/AccountDelegates/FeedlyAccountDelegate.swift +++ b/Account/Sources/Account/AccountDelegates/FeedlyAccountDelegate.swift @@ -617,7 +617,7 @@ final class FeedlyAccountDelegate: AccountDelegate { func fetchUpdatedArticleIDs(newerThan date: Date) async throws -> Set { // To replace FeedlyGetUpdatedArticleIDsOperation - + guard let userID = credentials?.username else { return Set() } var articleIDs = Set() @@ -640,6 +640,14 @@ final class FeedlyAccountDelegate: AccountDelegate { return articleIDs } + func updateAccountFeedsWithItems(account: Account, feedIDsAndItems: [String: Set]) async throws { + + // To replace FeedlyUpdateAccountFeedsWithItemsOperation + + try await account.update(feedIDsAndItems: feedIDsAndItems, defaultRead: true) + os_log(.debug, log: self.log, "Updated %i feeds", feedIDsAndItems.count) + } + // MARK: Suspend and Resume (for iOS) /// Suspend all network activity