Id -> ID renaming.

This commit is contained in:
Brent Simmons 2024-04-07 15:25:27 -07:00
parent 1a7c2251a3
commit c62e3293a6
6 changed files with 19 additions and 19 deletions

View File

@ -9,21 +9,21 @@
import Foundation
protocol FeedlyEntryIdentifierProviding: AnyObject {
@MainActor var entryIds: Set<String> { get }
@MainActor var entryIDs: Set<String> { get }
}
final class FeedlyEntryIdentifierProvider: FeedlyEntryIdentifierProviding {
private (set) var entryIds: Set<String>
private (set) var entryIDs: Set<String>
init(entryIds: Set<String> = Set()) {
self.entryIds = entryIds
init(entryIDs: Set<String> = 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)
}
}

View File

@ -35,8 +35,8 @@ 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)
@ -44,7 +44,7 @@ class FeedlyDownloadArticlesOperation: FeedlyOperation {
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)

View File

@ -13,7 +13,7 @@ final class FeedlyFetchIdsForMissingArticlesOperation: FeedlyOperation, FeedlyEn
private let account: Account
private(set) var entryIds = Set<String>()
private(set) var entryIDs = Set<String>()
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()

View File

@ -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

View File

@ -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<String> {
var entryIDs: Set<String> {
guard let ids = streamIds?.ids else {
assertionFailure("Has this operation been addeded as a dependency on the caller?")
return []

View File

@ -35,7 +35,7 @@ class FeedlyGetUpdatedArticleIdsOperation: FeedlyOperation, FeedlyEntryIdentifie
self.init(account: account, resource: all, service: service, newerThan: newerThan, log: log)
}
var entryIds: Set<String> {
var entryIDs: Set<String> {
return storedUpdatedArticleIds
}