Remove // To replace
comments now that the operations have been removed.
This commit is contained in:
parent
f87e96dc9e
commit
2f422b5141
@ -116,12 +116,9 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func refreshAll(for account: Account) async throws {
|
func refreshAll(for account: Account) async throws {
|
||||||
|
|
||||||
// To replace FeedlySyncAllOperation
|
|
||||||
|
|
||||||
if refreshing {
|
if refreshing {
|
||||||
os_log(.debug, log: log, "Ignoring refreshAll: Feedly sync already in progress.")
|
os_log(.debug, log: log, "Ignoring refreshAll: Feedly sync already in progress.")
|
||||||
return
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: update/clear refreshProgress
|
// TODO: update/clear refreshProgress
|
||||||
@ -388,8 +385,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func fetchUpdatedArticleIDs() async throws -> Set<String>? {
|
func fetchUpdatedArticleIDs() async throws -> Set<String>? {
|
||||||
|
|
||||||
// To replace FeedlyGetUpdatedArticleIDsOperation
|
|
||||||
|
|
||||||
guard let userID = credentials?.username else {
|
guard let userID = credentials?.username else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -425,8 +420,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func updateAccountFeedsWithItems(feedIDsAndItems: [String: Set<ParsedItem>]) async throws {
|
func updateAccountFeedsWithItems(feedIDsAndItems: [String: Set<ParsedItem>]) async throws {
|
||||||
|
|
||||||
// To replace FeedlyUpdateAccountFeedsWithItemsOperation
|
|
||||||
|
|
||||||
guard let account else { return }
|
guard let account else { return }
|
||||||
|
|
||||||
try await account.update(feedIDsAndItems: feedIDsAndItems, defaultRead: true)
|
try await account.update(feedIDsAndItems: feedIDsAndItems, defaultRead: true)
|
||||||
@ -435,8 +428,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func logout(account: Account) async throws {
|
func logout(account: Account) async throws {
|
||||||
|
|
||||||
// To replace FeedlyLogoutOperation
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
os_log("Requesting logout of Feedly account.")
|
os_log("Requesting logout of Feedly account.")
|
||||||
try await caller.logout()
|
try await caller.logout()
|
||||||
@ -454,8 +445,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
@discardableResult
|
@discardableResult
|
||||||
func addFeedToCollection(feedResource: FeedlyFeedResourceID, feedName: String? = nil, collectionID: String, folder: Folder) async throws -> [([FeedlyFeed], Folder)] {
|
func addFeedToCollection(feedResource: FeedlyFeedResourceID, feedName: String? = nil, collectionID: String, folder: Folder) async throws -> [([FeedlyFeed], Folder)] {
|
||||||
|
|
||||||
// To replace FeedlyAddFeedToCollectionOperation
|
|
||||||
|
|
||||||
let feedlyFeeds = try await caller.addFeed(with: feedResource, title: feedName, toCollectionWith: collectionID)
|
let feedlyFeeds = try await caller.addFeed(with: feedResource, title: feedName, toCollectionWith: collectionID)
|
||||||
|
|
||||||
let feedsWithCreatedFeedID = feedlyFeeds.filter { $0.id == feedResource.id }
|
let feedsWithCreatedFeedID = feedlyFeeds.filter { $0.id == feedResource.id }
|
||||||
@ -469,8 +458,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func parsedItemsKeyedByFeedURL(_ parsedItems: Set<ParsedItem>) -> [String: Set<ParsedItem>] {
|
func parsedItemsKeyedByFeedURL(_ parsedItems: Set<ParsedItem>) -> [String: Set<ParsedItem>] {
|
||||||
|
|
||||||
// To replace FeedlyOrganiseParsedItemsByFeedOperation
|
|
||||||
|
|
||||||
var d = [String: Set<ParsedItem>]()
|
var d = [String: Set<ParsedItem>]()
|
||||||
|
|
||||||
for parsedItem in parsedItems {
|
for parsedItem in parsedItems {
|
||||||
@ -491,8 +478,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func downloadArticles(missingArticleIDs: Set<String>?, updatedArticleIDs: Set<String>?) async throws {
|
func downloadArticles(missingArticleIDs: Set<String>?, updatedArticleIDs: Set<String>?) async throws {
|
||||||
|
|
||||||
// To replace FeedlyDownloadArticlesOperation
|
|
||||||
|
|
||||||
let allArticleIDs: Set<String> = {
|
let allArticleIDs: Set<String> = {
|
||||||
var articleIDs = Set<String>()
|
var articleIDs = Set<String>()
|
||||||
if let missingArticleIDs {
|
if let missingArticleIDs {
|
||||||
@ -521,8 +506,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func fetchParsedItems(articleIDs: Set<String>) async throws -> Set<ParsedItem> {
|
func fetchParsedItems(articleIDs: Set<String>) async throws -> Set<ParsedItem> {
|
||||||
|
|
||||||
// To replace FeedlyGetEntriesOperation
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
let entries = try await caller.getEntries(for: articleIDs)
|
let entries = try await caller.getEntries(for: articleIDs)
|
||||||
return parsedItems(with: Set(entries))
|
return parsedItems(with: Set(entries))
|
||||||
@ -544,8 +527,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func fetchCollections() async throws -> Set<FeedlyCollection> {
|
func fetchCollections() async throws -> Set<FeedlyCollection> {
|
||||||
|
|
||||||
// To replace FeedlyGetCollectionsOperation
|
|
||||||
|
|
||||||
os_log(.debug, log: log, "Requesting collections.")
|
os_log(.debug, log: log, "Requesting collections.")
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -560,8 +541,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func sendArticleStatuses() async throws {
|
func sendArticleStatuses() async throws {
|
||||||
|
|
||||||
// To replace FeedlySendArticleStatusesOperation
|
|
||||||
|
|
||||||
guard let syncStatuses = try await syncDatabase.selectForProcessing() else {
|
guard let syncStatuses = try await syncDatabase.selectForProcessing() else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -598,15 +577,11 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func searchForFeed(url: String) async throws -> FeedlyFeedsSearchResponse {
|
func searchForFeed(url: String) async throws -> FeedlyFeedsSearchResponse {
|
||||||
|
|
||||||
// To replace FeedlySearchOperation
|
|
||||||
|
|
||||||
try await caller.getFeeds(for: url, count: 1, localeIdentifier: Locale.current.identifier)
|
try await caller.getFeeds(for: url, count: 1, localeIdentifier: Locale.current.identifier)
|
||||||
}
|
}
|
||||||
|
|
||||||
func fetchStreamContents(resourceID: FeedlyResourceID, continuation: String? = nil, newerThan: Date?, unreadOnly: Bool? = nil) async throws -> Set<ParsedItem> {
|
func fetchStreamContents(resourceID: FeedlyResourceID, continuation: String? = nil, newerThan: Date?, unreadOnly: Bool? = nil) async throws -> Set<ParsedItem> {
|
||||||
|
|
||||||
// To replace FeedlyGetStreamContentsOperation
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
let stream = try await caller.getStreamContents(for: resourceID, continuation: continuation, newerThan: newerThan, unreadOnly: unreadOnly)
|
let stream = try await caller.getStreamContents(for: resourceID, continuation: continuation, newerThan: newerThan, unreadOnly: unreadOnly)
|
||||||
return parsedItems(with: Set(stream.items))
|
return parsedItems(with: Set(stream.items))
|
||||||
@ -697,8 +672,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func fetchAndProcessStarredArticleIDs() async throws {
|
func fetchAndProcessStarredArticleIDs() async throws {
|
||||||
|
|
||||||
// To replace FeedlyIngestStarredArticleIDsOperation
|
|
||||||
|
|
||||||
let remoteArticleIDs = try await fetchRemoteStarredArticleIDs()
|
let remoteArticleIDs = try await fetchRemoteStarredArticleIDs()
|
||||||
try await processStarredArticleIDs(remoteArticleIDs: remoteArticleIDs)
|
try await processStarredArticleIDs(remoteArticleIDs: remoteArticleIDs)
|
||||||
}
|
}
|
||||||
@ -749,8 +722,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func fetchAndProcessUnreadArticleIDs() async throws {
|
func fetchAndProcessUnreadArticleIDs() async throws {
|
||||||
|
|
||||||
// To replace FeedlyIngestUnreadArticleIDsOperation
|
|
||||||
|
|
||||||
let remoteArticleIDs = try await fetchRemoteUnreadArticleIDs()
|
let remoteArticleIDs = try await fetchRemoteUnreadArticleIDs()
|
||||||
try await processUnreadArticleIDs(remoteArticleIDs: remoteArticleIDs)
|
try await processUnreadArticleIDs(remoteArticleIDs: remoteArticleIDs)
|
||||||
}
|
}
|
||||||
@ -781,8 +752,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func fetchAndProcessAllArticleIDs() async throws {
|
func fetchAndProcessAllArticleIDs() async throws {
|
||||||
|
|
||||||
// To replace FeedlyIngestStreamArticleIDsOperation
|
|
||||||
|
|
||||||
guard let account else { return }
|
guard let account else { return }
|
||||||
|
|
||||||
let allArticleIDs = try await fetchAllArticleIDs()
|
let allArticleIDs = try await fetchAllArticleIDs()
|
||||||
@ -791,16 +760,12 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func syncStreamContents(feedResourceID: FeedlyFeedResourceID) async throws {
|
func syncStreamContents(feedResourceID: FeedlyFeedResourceID) async throws {
|
||||||
|
|
||||||
// To replace FeedlySyncStreamContentsOperation
|
|
||||||
|
|
||||||
let parsedItems = try await fetchStreamContents(resourceID: feedResourceID, newerThan: nil)
|
let parsedItems = try await fetchStreamContents(resourceID: feedResourceID, newerThan: nil)
|
||||||
try await updateAccountFeeds(parsedItems: parsedItems)
|
try await updateAccountFeeds(parsedItems: parsedItems)
|
||||||
}
|
}
|
||||||
|
|
||||||
func addNewFeed(url: String, feedName: String?, container: Container) async throws {
|
func addNewFeed(url: String, feedName: String?, container: Container) async throws {
|
||||||
|
|
||||||
// To replace FeedlyAddNewFeedOperation
|
|
||||||
|
|
||||||
let validator = FeedlyFeedContainerValidator(container: container)
|
let validator = FeedlyFeedContainerValidator(container: container)
|
||||||
let (folder, collectionID) = try validator.getValidContainer()
|
let (folder, collectionID) = try validator.getValidContainer()
|
||||||
|
|
||||||
@ -821,8 +786,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func addExistingFeed(resourceID: FeedlyFeedResourceID, container: Container, customFeedName: String? = nil) async throws {
|
func addExistingFeed(resourceID: FeedlyFeedResourceID, container: Container, customFeedName: String? = nil) async throws {
|
||||||
|
|
||||||
// To replace FeedlyAddExistingFeedOperation
|
|
||||||
|
|
||||||
let validator = FeedlyFeedContainerValidator(container: container)
|
let validator = FeedlyFeedContainerValidator(container: container)
|
||||||
let (folder, collectionID) = try validator.getValidContainer()
|
let (folder, collectionID) = try validator.getValidContainer()
|
||||||
|
|
||||||
@ -831,8 +794,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func mirrorCollectionsAsFolders(collections: Set<FeedlyCollection>) -> [([FeedlyFeed], Folder)]? {
|
func mirrorCollectionsAsFolders(collections: Set<FeedlyCollection>) -> [([FeedlyFeed], Folder)]? {
|
||||||
|
|
||||||
// To replace FeedlyMirrorCollectionsAsFoldersOperation
|
|
||||||
|
|
||||||
guard let account else { return nil }
|
guard let account else { return nil }
|
||||||
|
|
||||||
let localFolders = account.folders ?? Set()
|
let localFolders = account.folders ?? Set()
|
||||||
@ -866,8 +827,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
|
|
||||||
func createFeedsForCollectionFolders(feedsAndFolders: [([FeedlyFeed], Folder)]) {
|
func createFeedsForCollectionFolders(feedsAndFolders: [([FeedlyFeed], Folder)]) {
|
||||||
|
|
||||||
// To replace FeedlyCreateFeedsForCollectionFoldersOperation
|
|
||||||
|
|
||||||
guard let account else { return }
|
guard let account else { return }
|
||||||
|
|
||||||
let pairs = feedsAndFolders
|
let pairs = feedsAndFolders
|
||||||
|
Loading…
x
Reference in New Issue
Block a user