Add addExistingFeed function to replace FeedlyAddExistingFeedOperation.
This commit is contained in:
parent
e85e449dcc
commit
ec8cfa91e8
@ -954,7 +954,7 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
try await updateAccountFeeds(parsedItems: parsedItems)
|
try await updateAccountFeeds(parsedItems: parsedItems)
|
||||||
}
|
}
|
||||||
|
|
||||||
func addNewFeed(url: String, feedName: String?) async throws {
|
func addNewFeed(url: String, feedName: String?, container: Container) async throws {
|
||||||
|
|
||||||
// To replace FeedlyAddNewFeedOperation
|
// To replace FeedlyAddNewFeedOperation
|
||||||
|
|
||||||
@ -962,7 +962,7 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
let (folder, collectionID) = try validator.getValidContainer()
|
let (folder, collectionID) = try validator.getValidContainer()
|
||||||
|
|
||||||
let searchResponse = try await searchForFeed(url: url)
|
let searchResponse = try await searchForFeed(url: url)
|
||||||
guard let firstFeed = response.results.first else {
|
guard let firstFeed = searchResponse.results.first else {
|
||||||
throw AccountError.createErrorNotFound
|
throw AccountError.createErrorNotFound
|
||||||
}
|
}
|
||||||
let feedResourceID = FeedlyFeedResourceID(id: firstFeed.feedID)
|
let feedResourceID = FeedlyFeedResourceID(id: firstFeed.feedID)
|
||||||
@ -972,10 +972,20 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
|||||||
// TODO: FeedlyCreateFeedsForCollectionFoldersOperation replacement
|
// TODO: FeedlyCreateFeedsForCollectionFoldersOperation replacement
|
||||||
// let createFeeds = TODO
|
// let createFeeds = TODO
|
||||||
|
|
||||||
try await fetchAndProcessUnreadArticleIDs()
|
//try await fetchAndProcessUnreadArticleIDs() // TODO
|
||||||
try await syncStreamContents(feedResourceID: feedResourceID)
|
try await syncStreamContents(feedResourceID: feedResourceID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func addExistingFeed(resourceID: FeedlyFeedResourceID, container: Container, customFeedName: String? = nil) async throws {
|
||||||
|
|
||||||
|
// To replace FeedlyAddExistingFeedOperation
|
||||||
|
|
||||||
|
let validator = FeedlyFeedContainerValidator(container: container)
|
||||||
|
let (folder, collectionID) = try validator.getValidContainer()
|
||||||
|
|
||||||
|
try await addFeedToCollection(feedResource: resourceID, feedName: customFeedName, collectionID: collectionID, folder: folder)
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: Suspend and Resume (for iOS)
|
// MARK: Suspend and Resume (for iOS)
|
||||||
|
|
||||||
/// Suspend all network activity
|
/// Suspend all network activity
|
||||||
|
Loading…
x
Reference in New Issue
Block a user