From 04ba650bc8b0235646a3c835bff9a47467bc813d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kiel=20Gillard=20=F0=9F=A4=AA?= Date: Mon, 31 May 2021 09:12:39 +1000 Subject: [PATCH] Preserve custom feed names with Feedly when moving them between folders. Fixes #3109 --- .../Account/Feedly/FeedlyAccountDelegate.swift | 15 ++++++++------- .../FeedlyAddExistingFeedOperation.swift | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift b/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift index 0f9de2e5b..3108082fc 100644 --- a/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift +++ b/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift @@ -382,13 +382,14 @@ final class FeedlyAccountDelegate: AccountDelegate { } let resource = FeedlyFeedResourceId(id: feed.webFeedID) - let addExistingFeed = try FeedlyAddExistingFeedOperation(account: account, - credentials: credentials, - resource: resource, - service: caller, - container: container, - progress: refreshProgress, - log: log) + let addExistingFeed = try FeedlyAddExistingFeedOperation(account: account, + credentials: credentials, + resource: resource, + service: caller, + container: container, + progress: refreshProgress, + log: log, + customFeedName: feed.editedName) addExistingFeed.addCompletionHandler = { result in diff --git a/Account/Sources/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift b/Account/Sources/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift index 07dc4c8ca..ed0824663 100644 --- a/Account/Sources/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift +++ b/Account/Sources/Account/Feedly/Operations/FeedlyAddExistingFeedOperation.swift @@ -17,7 +17,7 @@ class FeedlyAddExistingFeedOperation: FeedlyOperation, FeedlyOperationDelegate, private let operationQueue = MainThreadOperationQueue() var addCompletionHandler: ((Result) -> ())? - init(account: Account, credentials: Credentials, resource: FeedlyFeedResourceId, service: FeedlyAddFeedToCollectionService, container: Container, progress: DownloadProgress, log: OSLog) throws { + init(account: Account, credentials: Credentials, resource: FeedlyFeedResourceId, service: FeedlyAddFeedToCollectionService, container: Container, progress: DownloadProgress, log: OSLog, customFeedName: String? = nil) throws { let validator = FeedlyFeedContainerValidator(container: container) let (folder, collectionId) = try validator.getValidContainer() @@ -28,7 +28,7 @@ class FeedlyAddExistingFeedOperation: FeedlyOperation, FeedlyOperationDelegate, self.downloadProgress = progress - let addRequest = FeedlyAddFeedToCollectionOperation(account: account, folder: folder, feedResource: resource, feedName: nil, 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)