From dd8df6e6c54027c2963ebf302fdb04d8b63ba2b3 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Thu, 14 Sep 2023 22:52:49 -0700 Subject: [PATCH] Continue renaming Id to ID in Feedly code. --- .../Account/Feedly/FeedlyAPICaller.swift | 2 +- .../Feedly/FeedlyAccountDelegate.swift | 4 ++-- .../FeedlyAddExistingFeedOperation.swift | 2 +- .../FeedlyAddFeedToCollectionOperation.swift | 14 +++++------ .../FeedlyAddNewFeedOperation.swift | 24 +++++++++---------- .../FeedlyDownloadArticlesOperation.swift | 14 +++++------ ...yFetchIdsForMissingArticlesOperation.swift | 4 ++-- .../FeedlyGetEntriesOperation.swift | 6 ++--- .../FeedlyGetStreamContentsOperation.swift | 6 ++--- .../Operations/FeedlySyncAllOperation.swift | 14 +++++------ 10 files changed, 45 insertions(+), 45 deletions(-) diff --git a/Account/Sources/Account/Feedly/FeedlyAPICaller.swift b/Account/Sources/Account/Feedly/FeedlyAPICaller.swift index cd546428c..2ac7acf40 100644 --- a/Account/Sources/Account/Feedly/FeedlyAPICaller.swift +++ b/Account/Sources/Account/Feedly/FeedlyAPICaller.swift @@ -132,7 +132,7 @@ final class FeedlyAPICaller { } } - func importOpml(_ opmlData: Data, completion: @escaping (Result) -> ()) { + func importOPML(_ opmlData: Data, completion: @escaping (Result) -> ()) { guard !isSuspended else { return DispatchQueue.main.async { completion(.failure(TransportError.suspended)) diff --git a/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift b/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift index ed5263d21..2fea079a0 100644 --- a/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift +++ b/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift @@ -223,7 +223,7 @@ final class FeedlyAccountDelegate: AccountDelegate, Logging { isOPMLImportInProgress = true refreshProgress.addToNumberOfTasksAndRemaining(1) - caller.importOpml(data) { result in + caller.importOPML(data) { result in switch result { case .success: self.logger.debug("Import OPML done.") @@ -326,7 +326,7 @@ final class FeedlyAccountDelegate: AccountDelegate, Logging { feedName: name, searchService: caller, addToCollectionService: caller, - syncUnreadIdsService: caller, + syncUnreadIDsService: caller, getStreamContentsService: caller, database: database, container: container, diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift index bfabe5f69..29ef60c9e 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift @@ -27,7 +27,7 @@ class FeedlyAddExistingFeedOperation: FeedlyOperation, FeedlyOperationDelegate, self.downloadProgress = progress - let addRequest = FeedlyAddFeedToCollectionOperation(account: account, folder: folder, feedResource: resource, feedName: customFeedName, collectionId: collectionId, service: service) + let addRequest = FeedlyAddFeedToCollectionOperation(account: account, folder: folder, feedResource: resource, feedName: customFeedName, collectionID: collectionId, service: service) addRequest.delegate = self addRequest.downloadProgress = progress self.operationQueue.add(addRequest) diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyAddFeedToCollectionOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyAddFeedToCollectionOperation.swift index db2f479a9..43e3f6bdd 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyAddFeedToCollectionOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyAddFeedToCollectionOperation.swift @@ -10,24 +10,24 @@ import Foundation import AccountError protocol FeedlyAddFeedToCollectionService { - func addFeed(with feedId: FeedlyFeedResourceID, title: String?, toCollectionWith collectionId: String, completion: @escaping (Result<[FeedlyFeed], Error>) -> ()) + func addFeed(with feedID: FeedlyFeedResourceID, title: String?, toCollectionWith collectionID: String, completion: @escaping (Result<[FeedlyFeed], Error>) -> ()) } final class FeedlyAddFeedToCollectionOperation: FeedlyOperation, FeedlyFeedsAndFoldersProviding, FeedlyResourceProviding { let feedName: String? - let collectionId: String + let collectionID: String let service: FeedlyAddFeedToCollectionService let account: Account let folder: Folder let feedResource: FeedlyFeedResourceID - init(account: Account, folder: Folder, feedResource: FeedlyFeedResourceID, feedName: String? = nil, collectionId: String, service: FeedlyAddFeedToCollectionService) { + init(account: Account, folder: Folder, feedResource: FeedlyFeedResourceID, feedName: String? = nil, collectionID: String, service: FeedlyAddFeedToCollectionService) { self.account = account self.folder = folder self.feedResource = feedResource self.feedName = feedName - self.collectionId = collectionId + self.collectionID = collectionID self.service = service } @@ -38,7 +38,7 @@ final class FeedlyAddFeedToCollectionOperation: FeedlyOperation, FeedlyFeedsAndF } override func run() { - service.addFeed(with: feedResource, title: feedName, toCollectionWith: collectionId) { [weak self] result in + service.addFeed(with: feedResource, title: feedName, toCollectionWith: collectionID) { [weak self] result in guard let self = self else { return } @@ -58,9 +58,9 @@ private extension FeedlyAddFeedToCollectionOperation { case .success(let feedlyFeeds): feedsAndFolders = [(feedlyFeeds, folder)] - let feedsWithCreatedFeedId = feedlyFeeds.filter { $0.id == resource.id } + let feedsWithCreatedFeedID = feedlyFeeds.filter { $0.id == resource.id } - if feedsWithCreatedFeedId.isEmpty { + if feedsWithCreatedFeedID.isEmpty { didFinish(with: AccountError.createErrorNotFound) } else { didFinish() diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift index c2b54baf1..44b9a20bc 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyAddNewFeedOperation.swift @@ -17,23 +17,23 @@ class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, Feedl private let operationQueue = MainThreadOperationQueue() private let folder: Folder - private let collectionId: String + private let collectionID: String private let url: String private let account: Account private let credentials: Credentials private let database: SyncDatabase private let feedName: String? private let addToCollectionService: FeedlyAddFeedToCollectionService - private let syncUnreadIdsService: FeedlyGetStreamIDsService + private let syncUnreadIDsService: FeedlyGetStreamIDsService private let getStreamContentsService: FeedlyGetStreamContentsService - private var feedResourceId: FeedlyFeedResourceID? + private var feedResourceID: FeedlyFeedResourceID? var addCompletionHandler: ((Result) -> ())? - init(account: Account, credentials: Credentials, url: String, feedName: String?, searchService: FeedlySearchService, addToCollectionService: FeedlyAddFeedToCollectionService, syncUnreadIdsService: FeedlyGetStreamIDsService, getStreamContentsService: FeedlyGetStreamContentsService, database: SyncDatabase, container: Container, progress: DownloadProgress) throws { + init(account: Account, credentials: Credentials, url: String, feedName: String?, searchService: FeedlySearchService, addToCollectionService: FeedlyAddFeedToCollectionService, syncUnreadIDsService: FeedlyGetStreamIDsService, getStreamContentsService: FeedlyGetStreamContentsService, database: SyncDatabase, container: Container, progress: DownloadProgress) throws { let validator = FeedlyFeedContainerValidator(container: container) - (self.folder, self.collectionId) = try validator.getValidContainer() + (self.folder, self.collectionID) = try validator.getValidContainer() self.url = url self.operationQueue.suspend() @@ -42,7 +42,7 @@ class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, Feedl self.database = database self.feedName = feedName self.addToCollectionService = addToCollectionService - self.syncUnreadIdsService = syncUnreadIdsService + self.syncUnreadIDsService = syncUnreadIDsService self.getStreamContentsService = getStreamContentsService super.init() @@ -81,10 +81,10 @@ class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, Feedl return didFinish(with: AccountError.createErrorNotFound) } - let feedResourceId = FeedlyFeedResourceID(id: first.feedId) - self.feedResourceId = feedResourceId + let feedResourceID = FeedlyFeedResourceID(id: first.feedId) + self.feedResourceID = feedResourceID - let addRequest = FeedlyAddFeedToCollectionOperation(account: account, folder: folder, feedResource: feedResourceId, feedName: feedName, collectionId: collectionId, service: addToCollectionService) + let addRequest = FeedlyAddFeedToCollectionOperation(account: account, folder: folder, feedResource: feedResourceID, feedName: feedName, collectionID: collectionID, service: addToCollectionService) addRequest.delegate = self addRequest.downloadProgress = downloadProgress operationQueue.add(addRequest) @@ -95,13 +95,13 @@ class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, Feedl createFeeds.downloadProgress = downloadProgress operationQueue.add(createFeeds) - let syncUnread = FeedlyIngestUnreadArticleIDsOperation(account: account, userID: credentials.username, service: syncUnreadIdsService, database: database, newerThan: nil) + let syncUnread = FeedlyIngestUnreadArticleIDsOperation(account: account, userID: credentials.username, service: syncUnreadIDsService, database: database, newerThan: nil) syncUnread.addDependency(createFeeds) syncUnread.downloadProgress = downloadProgress syncUnread.delegate = self operationQueue.add(syncUnread) - let syncFeed = FeedlySyncStreamContentsOperation(account: account, resource: feedResourceId, service: getStreamContentsService, isPagingEnabled: false, newerThan: nil) + let syncFeed = FeedlySyncStreamContentsOperation(account: account, resource: feedResourceID, service: getStreamContentsService, isPagingEnabled: false, newerThan: nil) syncFeed.addDependency(syncUnread) syncFeed.downloadProgress = downloadProgress syncFeed.delegate = self @@ -135,7 +135,7 @@ class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, Feedl guard let handler = addCompletionHandler else { return } - if let feedResource = feedResourceId, let feed = folder.existingFeed(withFeedID: feedResource.id) { + if let feedResource = feedResourceID, let feed = folder.existingFeed(withFeedID: feedResource.id) { handler(.success(feed)) } else { diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyDownloadArticlesOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyDownloadArticlesOperation.swift index 20a9262be..b1a9a02ae 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyDownloadArticlesOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyDownloadArticlesOperation.swift @@ -13,17 +13,17 @@ import RSWeb class FeedlyDownloadArticlesOperation: FeedlyOperation, Logging { private let account: Account - private let missingArticleEntryIdProvider: FeedlyEntryIdentifierProviding - private let updatedArticleEntryIdProvider: FeedlyEntryIdentifierProviding + private let missingArticleEntryIDProvider: FeedlyEntryIdentifierProviding + private let updatedArticleEntryIDProvider: FeedlyEntryIdentifierProviding private let getEntriesService: FeedlyGetEntriesService private let operationQueue = MainThreadOperationQueue() private let finishOperation: FeedlyCheckpointOperation - init(account: Account, missingArticleEntryIdProvider: FeedlyEntryIdentifierProviding, updatedArticleEntryIdProvider: FeedlyEntryIdentifierProviding, getEntriesService: FeedlyGetEntriesService) { + init(account: Account, missingArticleEntryIDProvider: FeedlyEntryIdentifierProviding, updatedArticleEntryIDProvider: FeedlyEntryIdentifierProviding, getEntriesService: FeedlyGetEntriesService) { self.account = account self.operationQueue.suspend() - self.missingArticleEntryIdProvider = missingArticleEntryIdProvider - self.updatedArticleEntryIdProvider = updatedArticleEntryIdProvider + self.missingArticleEntryIDProvider = missingArticleEntryIDProvider + self.updatedArticleEntryIDProvider = updatedArticleEntryIDProvider self.getEntriesService = getEntriesService self.finishOperation = FeedlyCheckpointOperation() super.init() @@ -32,8 +32,8 @@ class FeedlyDownloadArticlesOperation: FeedlyOperation, Logging { } override func run() { - var articleIds = missingArticleEntryIdProvider.entryIDs - articleIds.formUnion(updatedArticleEntryIdProvider.entryIDs) + var articleIds = missingArticleEntryIDProvider.entryIDs + articleIds.formUnion(updatedArticleEntryIDProvider.entryIDs) self.logger.debug("Requesting \(articleIds.count, privacy: .public) articles.") diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyFetchIdsForMissingArticlesOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyFetchIdsForMissingArticlesOperation.swift index a62f5923c..5d9d5991e 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyFetchIdsForMissingArticlesOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyFetchIdsForMissingArticlesOperation.swift @@ -1,5 +1,5 @@ // -// FeedlyFetchIdsForMissingArticlesOperation.swift +// FeedlyFetchIDsForMissingArticlesOperation.swift // Account // // Created by Kiel Gillard on 7/1/20. @@ -9,7 +9,7 @@ import Foundation import RSCore -final class FeedlyFetchIdsForMissingArticlesOperation: FeedlyOperation, FeedlyEntryIdentifierProviding, Logging { +final class FeedlyFetchIDsForMissingArticlesOperation: FeedlyOperation, FeedlyEntryIdentifierProviding, Logging { private let account: Account diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyGetEntriesOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyGetEntriesOperation.swift index 45be9a966..bcc800bef 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyGetEntriesOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyGetEntriesOperation.swift @@ -37,9 +37,9 @@ final class FeedlyGetEntriesOperation: FeedlyOperation, FeedlyEntryProviding, Fe }) if parsed.count != entries.count { - let entryIds = Set(entries.map { $0.id }) - let parsedIds = Set(parsed.map { $0.uniqueID }) - let difference = entryIds.subtracting(parsedIds) + let entryIDs = Set(entries.map { $0.id }) + let parsedIDs = Set(parsed.map { $0.uniqueID }) + let difference = entryIDs.subtracting(parsedIDs) self.logger.debug("\(String(describing: self), privacy: .public) dropping articles with ids: \(difference)).") } diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyGetStreamContentsOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyGetStreamContentsOperation.swift index cc9269d96..2da0067ff 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyGetStreamContentsOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyGetStreamContentsOperation.swift @@ -55,9 +55,9 @@ final class FeedlyGetStreamContentsOperation: FeedlyOperation, FeedlyEntryProvid }) if parsed.count != entries.count { - let entryIds = Set(entries.map { $0.id }) - let parsedIds = Set(parsed.map { $0.uniqueID }) - let difference = entryIds.subtracting(parsedIds) + let entryIDs = Set(entries.map { $0.id }) + let parsedIDs = Set(parsed.map { $0.uniqueID }) + let difference = entryIDs.subtracting(parsedIDs) logger.debug("Dropping articles with ids: \(difference, privacy: .public)") } diff --git a/Account/Sources/Account/Feedly/Operations/FeedlySyncAllOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlySyncAllOperation.swift index 3c25e37f2..6b25b72ab 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlySyncAllOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlySyncAllOperation.swift @@ -32,7 +32,7 @@ final class FeedlySyncAllOperation: FeedlyOperation, Logging { /// /// Download articles for statuses at the union of those statuses without its corresponding article and those included in 3 (changed since last successful sync). /// - init(account: Account, feedlyUserID: String, lastSuccessfulFetchStartDate: Date?, markArticlesService: FeedlyMarkArticlesService, getUnreadService: FeedlyGetStreamIDsService, getCollectionsService: FeedlyGetCollectionsService, getStreamContentsService: FeedlyGetStreamContentsService, getStarredService: FeedlyGetStreamIDsService, getStreamIdsService: FeedlyGetStreamIDsService, getEntriesService: FeedlyGetEntriesService, database: SyncDatabase, downloadProgress: DownloadProgress) { + init(account: Account, feedlyUserID: String, lastSuccessfulFetchStartDate: Date?, markArticlesService: FeedlyMarkArticlesService, getUnreadService: FeedlyGetStreamIDsService, getCollectionsService: FeedlyGetCollectionsService, getStreamContentsService: FeedlyGetStreamContentsService, getStarredService: FeedlyGetStreamIDsService, getStreamIDsService: FeedlyGetStreamIDsService, getEntriesService: FeedlyGetEntriesService, database: SyncDatabase, downloadProgress: DownloadProgress) { self.syncUUID = UUID() self.operationQueue.suspend() @@ -65,7 +65,7 @@ final class FeedlySyncAllOperation: FeedlyOperation, Logging { createFeedsOperation.addDependency(mirrorCollectionsAsFolders) self.operationQueue.add(createFeedsOperation) - let getAllArticleIDs = FeedlyIngestStreamArticleIDsOperation(account: account, userId: feedlyUserID, service: getStreamIdsService) + let getAllArticleIDs = FeedlyIngestStreamArticleIDsOperation(account: account, userId: feedlyUserID, service: getStreamIDsService) getAllArticleIDs.delegate = self getAllArticleIDs.downloadProgress = downloadProgress getAllArticleIDs.addDependency(createFeedsOperation) @@ -80,7 +80,7 @@ final class FeedlySyncAllOperation: FeedlyOperation, Logging { // Get each page of the article ids which have been update since the last successful fetch start date. // If the date is nil, this operation provides an empty set (everything is new, nothing is updated). - let getUpdated = FeedlyGetUpdatedArticleIDsOperation(account: account, userID: feedlyUserID, service: getStreamIdsService, newerThan: lastSuccessfulFetchStartDate) + let getUpdated = FeedlyGetUpdatedArticleIDsOperation(account: account, userID: feedlyUserID, service: getStreamIDsService, newerThan: lastSuccessfulFetchStartDate) getUpdated.delegate = self getUpdated.downloadProgress = downloadProgress getUpdated.addDependency(createFeedsOperation) @@ -94,7 +94,7 @@ final class FeedlySyncAllOperation: FeedlyOperation, Logging { self.operationQueue.add(getStarred) // Now all the possible article ids we need have a status, fetch the article ids for missing articles. - let getMissingIDs = FeedlyFetchIdsForMissingArticlesOperation(account: account) + let getMissingIDs = FeedlyFetchIDsForMissingArticlesOperation(account: account) getMissingIDs.delegate = self getMissingIDs.downloadProgress = downloadProgress getMissingIDs.addDependency(getAllArticleIDs) @@ -105,8 +105,8 @@ final class FeedlySyncAllOperation: FeedlyOperation, Logging { // Download all the missing and updated articles let downloadMissingArticles = FeedlyDownloadArticlesOperation(account: account, - missingArticleEntryIdProvider: getMissingIDs, - updatedArticleEntryIdProvider: getUpdated, + missingArticleEntryIDProvider: getMissingIDs, + updatedArticleEntryIDProvider: getUpdated, getEntriesService: getEntriesService) downloadMissingArticles.delegate = self downloadMissingArticles.downloadProgress = downloadProgress @@ -123,7 +123,7 @@ final class FeedlySyncAllOperation: FeedlyOperation, Logging { } convenience init(account: Account, feedlyUserID: String, caller: FeedlyAPICaller, database: SyncDatabase, lastSuccessfulFetchStartDate: Date?, downloadProgress: DownloadProgress) { - self.init(account: account, feedlyUserID: feedlyUserID, lastSuccessfulFetchStartDate: lastSuccessfulFetchStartDate, markArticlesService: caller, getUnreadService: caller, getCollectionsService: caller, getStreamContentsService: caller, getStarredService: caller, getStreamIdsService: caller, getEntriesService: caller, database: database, downloadProgress: downloadProgress) + self.init(account: account, feedlyUserID: feedlyUserID, lastSuccessfulFetchStartDate: lastSuccessfulFetchStartDate, markArticlesService: caller, getUnreadService: caller, getCollectionsService: caller, getStreamContentsService: caller, getStarredService: caller, getStreamIDsService: caller, getEntriesService: caller, database: database, downloadProgress: downloadProgress) } override func run() {