From c62e3293a6e18fe92af4ebcdf950cfa3e9df5162 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 7 Apr 2024 15:25:27 -0700 Subject: [PATCH] Id -> ID renaming. --- .../FeedlyEntryIdentifierProviding.swift | 18 +++++++++--------- .../FeedlyDownloadArticlesOperation.swift | 8 ++++---- ...lyFetchIdsForMissingArticlesOperation.swift | 6 +++--- .../Operations/FeedlyGetEntriesOperation.swift | 2 +- .../FeedlyGetStreamIdsOperation.swift | 2 +- .../FeedlyGetUpdatedArticleIdsOperation.swift | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Account/Sources/Account/Feedly/Models/FeedlyEntryIdentifierProviding.swift b/Account/Sources/Account/Feedly/Models/FeedlyEntryIdentifierProviding.swift index 9801268ca..19b2a1e4d 100644 --- a/Account/Sources/Account/Feedly/Models/FeedlyEntryIdentifierProviding.swift +++ b/Account/Sources/Account/Feedly/Models/FeedlyEntryIdentifierProviding.swift @@ -9,21 +9,21 @@ import Foundation protocol FeedlyEntryIdentifierProviding: AnyObject { - @MainActor var entryIds: Set { get } + @MainActor var entryIDs: Set { get } } final class FeedlyEntryIdentifierProvider: FeedlyEntryIdentifierProviding { - private (set) var entryIds: Set - - init(entryIds: Set = Set()) { - self.entryIds = entryIds + private (set) var entryIDs: Set + + init(entryIDs: Set = Set()) { + self.entryIDs = entryIDs } - @MainActor func addEntryIds(from provider: FeedlyEntryIdentifierProviding) { - entryIds.formUnion(provider.entryIds) + @MainActor func addEntryIDs(from provider: FeedlyEntryIdentifierProviding) { + entryIDs.formUnion(provider.entryIDs) } - @MainActor func addEntryIds(in articleIds: [String]) { - entryIds.formUnion(articleIds) + @MainActor func addEntryIDs(in articleIds: [String]) { + entryIDs.formUnion(articleIds) } } diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyDownloadArticlesOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyDownloadArticlesOperation.swift index 0a97bd6ae..56d9c45df 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyDownloadArticlesOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyDownloadArticlesOperation.swift @@ -35,16 +35,16 @@ class FeedlyDownloadArticlesOperation: FeedlyOperation { } override func run() { - var articleIds = missingArticleEntryIdProvider.entryIds - articleIds.formUnion(updatedArticleEntryIdProvider.entryIds) - + var articleIds = missingArticleEntryIdProvider.entryIDs + articleIds.formUnion(updatedArticleEntryIdProvider.entryIDs) + os_log(.debug, log: log, "Requesting %{public}i articles.", articleIds.count) let feedlyAPILimitBatchSize = 1000 for articleIds in Array(articleIds).chunked(into: feedlyAPILimitBatchSize) { Task { @MainActor in - let provider = FeedlyEntryIdentifierProvider(entryIds: Set(articleIds)) + let provider = FeedlyEntryIdentifierProvider(entryIDs: Set(articleIds)) let getEntries = FeedlyGetEntriesOperation(service: getEntriesService, provider: provider, log: log) getEntries.delegate = self self.operationQueue.add(getEntries) diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyFetchIdsForMissingArticlesOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyFetchIdsForMissingArticlesOperation.swift index b939daa4f..3abf0d6f8 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyFetchIdsForMissingArticlesOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyFetchIdsForMissingArticlesOperation.swift @@ -13,8 +13,8 @@ final class FeedlyFetchIdsForMissingArticlesOperation: FeedlyOperation, FeedlyEn private let account: Account - private(set) var entryIds = Set() - + private(set) var entryIDs = Set() + init(account: Account) { self.account = account } @@ -25,7 +25,7 @@ final class FeedlyFetchIdsForMissingArticlesOperation: FeedlyOperation, FeedlyEn do { if let articleIDs = try await account.fetchArticleIDsForStatusesWithoutArticlesNewerThanCutoffDate() { - self.entryIds.formUnion(articleIDs) + self.entryIDs.formUnion(articleIDs) } self.didFinish() diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyGetEntriesOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyGetEntriesOperation.swift index 582d43d88..472ed76c4 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyGetEntriesOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyGetEntriesOperation.swift @@ -54,7 +54,7 @@ final class FeedlyGetEntriesOperation: FeedlyOperation, FeedlyEntryProviding, Fe } override func run() { - service.getEntries(for: provider.entryIds) { result in + service.getEntries(for: provider.entryIDs) { result in switch result { case .success(let entries): self.entries = entries diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyGetStreamIdsOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyGetStreamIdsOperation.swift index 602520720..43bd0762b 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyGetStreamIdsOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyGetStreamIdsOperation.swift @@ -16,7 +16,7 @@ protocol FeedlyGetStreamIdsOperationDelegate: AnyObject { /// Single responsibility is to get the stream ids from Feedly. final class FeedlyGetStreamIdsOperation: FeedlyOperation, FeedlyEntryIdentifierProviding { - var entryIds: Set { + var entryIDs: Set { guard let ids = streamIds?.ids else { assertionFailure("Has this operation been addeded as a dependency on the caller?") return [] diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyGetUpdatedArticleIdsOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyGetUpdatedArticleIdsOperation.swift index 09968d750..ddb905f65 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyGetUpdatedArticleIdsOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyGetUpdatedArticleIdsOperation.swift @@ -35,7 +35,7 @@ class FeedlyGetUpdatedArticleIdsOperation: FeedlyOperation, FeedlyEntryIdentifie self.init(account: account, resource: all, service: service, newerThan: newerThan, log: log) } - var entryIds: Set { + var entryIDs: Set { return storedUpdatedArticleIds }