Rename WebFeed type to just Feed.

This commit is contained in:
Brent Simmons
2023-07-05 10:02:53 -07:00
parent d5d57a7e30
commit 2f07f4ee16
50 changed files with 393 additions and 393 deletions

View File

@@ -73,10 +73,10 @@ extension NSApplication : ScriptingObjectContainer {
for 'articles of feed "The Shape of Everything" of account "On My Mac"'
*/
func allWebFeeds() -> [WebFeed] {
func allWebFeeds() -> [Feed] {
let accounts = AccountManager.shared.activeAccounts
let emptyFeeds:[WebFeed] = []
return accounts.reduce(emptyFeeds) { (result, nthAccount) -> [WebFeed] in
let emptyFeeds:[Feed] = []
return accounts.reduce(emptyFeeds) { (result, nthAccount) -> [Feed] in
let accountFeeds = Array(nthAccount.topLevelFeeds)
return result + accountFeeds
}
@@ -91,7 +91,7 @@ extension NSApplication : ScriptingObjectContainer {
@objc(valueInWebFeedsWithUniqueID:)
func valueInWebFeeds(withUniqueID id:String) -> ScriptableFeed? {
let webFeeds = self.allWebFeeds()
guard let webFeed = webFeeds.first(where:{$0.webFeedID == id}) else { return nil }
guard let webFeed = webFeeds.first(where:{$0.feedID == id}) else { return nil }
return ScriptableFeed(webFeed, container:self)
}
}

View File

@@ -14,10 +14,10 @@ import Articles
@objc(ScriptableFeed)
class ScriptableFeed: NSObject, UniqueIdScriptingObject, ScriptingObjectContainer {
let feed:WebFeed
let container:ScriptingObjectContainer
let feed: Feed
let container: ScriptingObjectContainer
init (_ feed:WebFeed, container:ScriptingObjectContainer) {
init (_ feed: Feed, container:ScriptingObjectContainer) {
self.feed = feed
self.container = container
}
@@ -45,7 +45,7 @@ class ScriptableFeed: NSObject, UniqueIdScriptingObject, ScriptingObjectContaine
// but in either case it seems like the accountID would be used as the keydata, so I chose ID
@objc(uniqueId)
var scriptingUniqueId:Any {
return feed.webFeedID
return feed.feedID
}
// MARK: --- ScriptingObjectContainer protocol ---
@@ -71,7 +71,7 @@ class ScriptableFeed: NSObject, UniqueIdScriptingObject, ScriptingObjectContaine
return url
}
class func scriptableFeed(_ feed:WebFeed, account:Account, folder:Folder?) -> ScriptableFeed {
class func scriptableFeed(_ feed: Feed, account: Account, folder: Folder?) -> ScriptableFeed {
let scriptableAccount = ScriptableAccount(account)
if let folder = folder {
let scriptableFolder = ScriptableFolder(folder, container:scriptableAccount)