mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-29 00:31:14 +00:00
Use best feed specifier code to determine which Feedbin option to use when creating a feed
This commit is contained in:
1 parent
a7d1014d5b
commit
fe70723eb4
10 files changed
+94
-98
No files matched your search
@@ -102,32 +102,25 @@ class ScriptableFeed: NSObject, UniqueIdScriptingObject, ScriptingObjectContaine
|
||||
|
||||
account.createFeed(url: url) { result in
|
||||
switch result {
|
||||
case .success(let createFeedResult):
|
||||
case .success(let feed):
|
||||
|
||||
switch createFeedResult {
|
||||
case .created(let feed):
|
||||
|
||||
if let editedName = titleFromArgs {
|
||||
account.renameFeed(feed, to: editedName) { result in
|
||||
}
|
||||
if let editedName = titleFromArgs {
|
||||
account.renameFeed(feed, to: editedName) { result in
|
||||
}
|
||||
|
||||
// add the feed, putting it in a folder if needed
|
||||
account.addFeed(feed) { result in
|
||||
switch result {
|
||||
case .success:
|
||||
NotificationCenter.default.post(name: .UserDidAddFeed, object: self, userInfo: [UserInfoKey.feed: feed])
|
||||
let scriptableFeed = self.scriptableFeed(feed, account:account, folder:folder)
|
||||
command.resumeExecution(withResult:scriptableFeed.objectSpecifier)
|
||||
case .failure:
|
||||
command.resumeExecution(withResult:nil)
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
command.resumeExecution(withResult:nil)
|
||||
}
|
||||
|
||||
|
||||
// add the feed, putting it in a folder if needed
|
||||
account.addFeed(feed) { result in
|
||||
switch result {
|
||||
case .success:
|
||||
NotificationCenter.default.post(name: .UserDidAddFeed, object: self, userInfo: [UserInfoKey.feed: feed])
|
||||
let scriptableFeed = self.scriptableFeed(feed, account:account, folder:folder)
|
||||
command.resumeExecution(withResult:scriptableFeed.objectSpecifier)
|
||||
case .failure:
|
||||
command.resumeExecution(withResult:nil)
|
||||
}
|
||||
}
|
||||
|
||||
case .failure:
|
||||
command.resumeExecution(withResult:nil)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user