Store feed.homePageURL in ODB.

This commit is contained in:
Brent Simmons 2018-09-14 22:23:30 -07:00
parent fb9590de98
commit 904feb9950
1 changed files with 3 additions and 8 deletions

View File

@ -33,17 +33,16 @@ public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable {
public let url: String public let url: String
public let feedID: String public let feedID: String
private var _homePageURL: String?
public var homePageURL: String? { public var homePageURL: String? {
get { get {
return _homePageURL return settingsTable.string(for: Key.homePageURL)
} }
set { set {
if let url = newValue { if let url = newValue {
_homePageURL = url.rs_normalizedURL() settingsTable.setString(url.rs_normalizedURL(), for: Key.homePageURL)
} }
else { else {
_homePageURL = nil settingsTable.setString(nil, for: Key.homePageURL)
} }
} }
} }
@ -147,7 +146,6 @@ public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable {
let feedID = dictionary[Key.feedID] as? String ?? url let feedID = dictionary[Key.feedID] as? String ?? url
self.init(account: account, url: url, feedID: feedID) self.init(account: account, url: url, feedID: feedID)
self.homePageURL = dictionary[Key.homePageURL] as? String
self.name = dictionary[Key.name] as? String self.name = dictionary[Key.name] as? String
self.editedName = dictionary[Key.editedName] as? String self.editedName = dictionary[Key.editedName] as? String
@ -171,9 +169,6 @@ public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable {
d[Key.feedID] = feedID d[Key.feedID] = feedID
} }
if let homePageURL = homePageURL {
d[Key.homePageURL] = homePageURL
}
if let name = name { if let name = name {
d[Key.name] = name d[Key.name] = name
} }