mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Continue changing webFeed to feed.
This commit is contained in:
@@ -97,7 +97,7 @@ class AddFeedViewController: UITableViewController {
|
||||
account = containerAccount
|
||||
}
|
||||
|
||||
if account!.hasWebFeed(withURL: url.absoluteString) {
|
||||
if account!.hasFeed(withURL: url.absoluteString) {
|
||||
presentError(AccountError.createErrorAlreadySubscribed)
|
||||
return
|
||||
}
|
||||
@@ -110,7 +110,7 @@ class AddFeedViewController: UITableViewController {
|
||||
|
||||
BatchUpdate.shared.start()
|
||||
|
||||
account!.createWebFeed(url: url.absoluteString, name: feedName, container: container, validateFeed: true) { result in
|
||||
account!.createFeed(url: url.absoluteString, name: feedName, container: container, validateFeed: true) { result in
|
||||
|
||||
BatchUpdate.shared.end()
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ extension MasterFeedViewController: UITableViewDropDelegate {
|
||||
|
||||
// Validate account specific behaviors...
|
||||
if correctDestAccount.behaviors.contains(.disallowFeedInMultipleFolders),
|
||||
sourceWebFeed.account?.accountID != correctDestAccount.accountID && correctDestAccount.hasWebFeed(withURL: sourceWebFeed.url) {
|
||||
sourceWebFeed.account?.accountID != correctDestAccount.accountID && correctDestAccount.hasFeed(withURL: sourceWebFeed.url) {
|
||||
return UITableViewDropProposal(operation: .forbidden)
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ extension MasterFeedViewController: UITableViewDropDelegate {
|
||||
guard let destination = destinationContainer, let webFeed = dragNode.representedObject as? WebFeed else { return }
|
||||
|
||||
if source.account == destination.account {
|
||||
moveWebFeedInAccount(feed: webFeed, sourceContainer: source, destinationContainer: destination)
|
||||
moveFeedInAccount(feed: webFeed, sourceContainer: source, destinationContainer: destination)
|
||||
} else {
|
||||
copyWebFeedBetweenAccounts(feed: webFeed, sourceContainer: source, destinationContainer: destination)
|
||||
}
|
||||
@@ -138,11 +138,11 @@ private extension MasterFeedViewController {
|
||||
return correctDestination
|
||||
}
|
||||
|
||||
func moveWebFeedInAccount(feed: WebFeed, sourceContainer: Container, destinationContainer: Container) {
|
||||
func moveFeedInAccount(feed: WebFeed, sourceContainer: Container, destinationContainer: Container) {
|
||||
guard sourceContainer !== destinationContainer else { return }
|
||||
|
||||
BatchUpdate.shared.start()
|
||||
sourceContainer.account?.moveWebFeed(feed, from: sourceContainer, to: destinationContainer) { result in
|
||||
sourceContainer.account?.moveFeed(feed, from: sourceContainer, to: destinationContainer) { result in
|
||||
BatchUpdate.shared.end()
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -155,10 +155,10 @@ private extension MasterFeedViewController {
|
||||
|
||||
func copyWebFeedBetweenAccounts(feed: WebFeed, sourceContainer: Container, destinationContainer: Container) {
|
||||
|
||||
if let existingFeed = destinationContainer.account?.existingWebFeed(withURL: feed.url) {
|
||||
if let existingFeed = destinationContainer.account?.existingFeed(withURL: feed.url) {
|
||||
|
||||
BatchUpdate.shared.start()
|
||||
destinationContainer.account?.addWebFeed(existingFeed, to: destinationContainer) { result in
|
||||
destinationContainer.account?.addFeed(existingFeed, to: destinationContainer) { result in
|
||||
switch result {
|
||||
case .success:
|
||||
BatchUpdate.shared.end()
|
||||
@@ -171,7 +171,7 @@ private extension MasterFeedViewController {
|
||||
} else {
|
||||
|
||||
BatchUpdate.shared.start()
|
||||
destinationContainer.account?.createWebFeed(url: feed.url, name: feed.editedName, container: destinationContainer, validateFeed: false) { result in
|
||||
destinationContainer.account?.createFeed(url: feed.url, name: feed.editedName, container: destinationContainer, validateFeed: false) { result in
|
||||
switch result {
|
||||
case .success:
|
||||
BatchUpdate.shared.end()
|
||||
@@ -190,7 +190,7 @@ private extension MasterFeedViewController {
|
||||
private extension Container {
|
||||
|
||||
func hasChildWebFeed(withURL url: String) -> Bool {
|
||||
return topLevelWebFeeds.contains(where: { $0.url == url })
|
||||
return topLevelFeeds.contains(where: { $0.url == url })
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1495,7 +1495,7 @@ private extension SceneCoordinator {
|
||||
treeControllerDelegate.addFilterException(feedID)
|
||||
}
|
||||
} else if let webFeed = feed as? WebFeed {
|
||||
if webFeed.account?.existingWebFeed(withWebFeedID: webFeed.webFeedID) != nil {
|
||||
if webFeed.account?.existingFeed(withWebFeedID: webFeed.webFeedID) != nil {
|
||||
treeControllerDelegate.addFilterException(feedID)
|
||||
addParentFolderToFilterExceptions(webFeed)
|
||||
}
|
||||
@@ -2016,7 +2016,7 @@ private extension SceneCoordinator {
|
||||
if !unsortedArticleIDs.contains(article.articleID) {
|
||||
updatedArticles.insert(article)
|
||||
}
|
||||
if article.account?.existingWebFeed(withWebFeedID: article.webFeedID) == nil {
|
||||
if article.account?.existingFeed(withWebFeedID: article.webFeedID) == nil {
|
||||
updatedArticles.remove(article)
|
||||
}
|
||||
}
|
||||
@@ -2101,7 +2101,7 @@ private extension SceneCoordinator {
|
||||
}
|
||||
} else if let folder = timelineFeed as? Folder {
|
||||
for oneFeed in feeds {
|
||||
if folder.hasWebFeed(with: oneFeed.webFeedID) || folder.hasWebFeed(withURL: oneFeed.url) {
|
||||
if folder.hasFeed(with: oneFeed.webFeedID) || folder.hasFeed(withURL: oneFeed.url) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -2175,7 +2175,7 @@ private extension SceneCoordinator {
|
||||
case .webFeed(let accountID, let webFeedID):
|
||||
guard let accountNode = findAccountNode(accountID: accountID),
|
||||
let account = accountNode.representedObject as? Account,
|
||||
let webFeed = account.existingWebFeed(withWebFeedID: webFeedID) else {
|
||||
let webFeed = account.existingFeed(withWebFeedID: webFeedID) else {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2204,7 +2204,7 @@ private extension SceneCoordinator {
|
||||
return
|
||||
}
|
||||
|
||||
guard let webFeed = account.existingWebFeed(withWebFeedID: webFeedID) else {
|
||||
guard let webFeed = account.existingFeed(withWebFeedID: webFeedID) else {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ struct NewArticleNotificationsView: View, Logging {
|
||||
return
|
||||
}
|
||||
activeAccounts.forEach { account in
|
||||
for feed in Array(account.flattenedWebFeeds()) {
|
||||
for feed in Array(account.flattenedFeeds()) {
|
||||
if let feedURLHost = URL(string: feed.url)?.host {
|
||||
if faviconHost == feedURLHost {
|
||||
feed.objectWillChange.send()
|
||||
@@ -50,7 +50,7 @@ struct NewArticleNotificationsView: View, Logging {
|
||||
}
|
||||
|
||||
private func sortedWebFeedsForAccount(_ account: Account) -> [WebFeed] {
|
||||
return Array(account.flattenedWebFeeds()).sorted(by: { $0.nameForDisplay.caseInsensitiveCompare($1.nameForDisplay) == .orderedAscending })
|
||||
return Array(account.flattenedFeeds()).sorted(by: { $0.nameForDisplay.caseInsensitiveCompare($1.nameForDisplay) == .orderedAscending })
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user