Save and restore iconURL in Feed.

This commit is contained in:
Brent Simmons 2017-11-19 22:37:59 -08:00
parent 26cc99db54
commit 0284117bc3

View File

@ -16,6 +16,7 @@ public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable {
public let url: String public let url: String
public let feedID: String public let feedID: String
public var homePageURL: String? public var homePageURL: String?
public var iconURL: String?
public var faviconURL: String? public var faviconURL: String?
public var name: String? public var name: String?
public var editedName: String? public var editedName: String?
@ -57,6 +58,7 @@ public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable {
static let url = "url" static let url = "url"
static let feedID = "feedID" static let feedID = "feedID"
static let homePageURL = "homePageURL" static let homePageURL = "homePageURL"
static let iconURL = "iconURL"
static let faviconURL = "faviconURL" static let faviconURL = "faviconURL"
static let name = "name" static let name = "name"
static let editedName = "editedName" static let editedName = "editedName"
@ -74,6 +76,7 @@ public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable {
self.init(accountID: accountID, url: url, feedID: feedID) self.init(accountID: accountID, url: url, feedID: feedID)
self.homePageURL = dictionary[Key.homePageURL] as? String self.homePageURL = dictionary[Key.homePageURL] as? String
self.iconURL = dictionary[Key.iconURL] as? String
self.faviconURL = dictionary[Key.faviconURL] as? String self.faviconURL = dictionary[Key.faviconURL] 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
@ -107,6 +110,9 @@ public final class Feed: DisplayNameProvider, UnreadCountProvider, Hashable {
if let homePageURL = homePageURL { if let homePageURL = homePageURL {
d[Key.homePageURL] = homePageURL d[Key.homePageURL] = homePageURL
} }
if let iconURL = iconURL {
d[Key.iconURL] = iconURL
}
if let faviconURL = faviconURL { if let faviconURL = faviconURL {
d[Key.faviconURL] = faviconURL d[Key.faviconURL] = faviconURL
} }