mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-02 12:06:58 +01:00
Start work on replacements for Feedly operations. This function will eventually replace FeedlyGetUpdatedArticleIDsOperation.
This commit is contained in:
parent
ed957d92cf
commit
8e3c0b3683
@ -614,6 +614,32 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
||||
return credentials
|
||||
}
|
||||
|
||||
func fetchUpdatedArticleIDs(newerThan date: Date) async throws -> Set<String> {
|
||||
|
||||
// To replace FeedlyGetUpdatedArticleIDsOperation
|
||||
|
||||
guard let userID = credentials?.username else { return Set<String>() }
|
||||
|
||||
var articleIDs = Set<String>()
|
||||
let resource = FeedlyCategoryResourceID.Global.all(for: userID)
|
||||
|
||||
func fetchStreamIDs(_ continuation: String?) async throws {
|
||||
|
||||
let streamIDs = try await caller.getStreamIDs(for: resource, continuation: continuation, newerThan: date, unreadOnly: nil)
|
||||
|
||||
articleIDs.formUnion(streamIDs.ids)
|
||||
|
||||
guard let continuation = streamIDs.continuation else {
|
||||
os_log(.debug, log: log, "%{public}i articles updated since last successful sync start date.", articleIDs.count)
|
||||
return
|
||||
}
|
||||
|
||||
try await fetchStreamIDs(continuation)
|
||||
}
|
||||
|
||||
return articleIDs
|
||||
}
|
||||
|
||||
// MARK: Suspend and Resume (for iOS)
|
||||
|
||||
/// Suspend all network activity
|
||||
|
Loading…
x
Reference in New Issue
Block a user