Fix Account-Database init method.

This commit is contained in:
Brent Simmons 2017-08-22 07:45:09 -07:00
parent 5860f774bd
commit becbf3d7b0
2 changed files with 4 additions and 7 deletions

View File

@ -12,7 +12,7 @@ public final class Article: Hashable {
weak var account: Account? weak var account: Account?
public let articleID: String public let articleID: String // Unique database ID
public let feedID: String // Likely a URL, but not necessarily public let feedID: String // Likely a URL, but not necessarily
public let uniqueID: String // Unique per feed (RSS guid, for example) public let uniqueID: String // Unique per feed (RSS guid, for example)
public var title: String? public var title: String?

View File

@ -32,15 +32,12 @@ extension Article {
let bannerImageURL = row.string(forColumn: DatabaseKey.bannerImageURL) let bannerImageURL = row.string(forColumn: DatabaseKey.bannerImageURL)
let datePublished = row.date(forColumn: DatabaseKey.datePublished) let datePublished = row.date(forColumn: DatabaseKey.datePublished)
let dateModified = row.date(forColumn: DatabaseKey.dateModified) let dateModified = row.date(forColumn: DatabaseKey.dateModified)
let accountInfo: [String: Any]? = nil // TODO
// authors, tags, and attachments are fetched from related tables, after init.
let authors: [Author]? = nil let authors: [Author]? = nil
let tags: Set<String>? = nil let tags: Set<String>? = nil
let attachments: [Attachment]? = nil let attachments: [Attachment]? = nil
let accountInfo: [String: Any]? = nil
// let authors = PropertyListTransformer.authorsWithRow(row)
// let tags = PropertyListTransformer.tagsWithRow(row)
// let attachments = PropertyListTransformer.attachmentsWithRow(row)
// let accountInfo = accountInfoWithRow(row)
self.init(account: account, articleID: articleID, feedID: feedID, uniqueID: uniqueID, title: title, contentHTML: contentHTML, contentText: contentText, url: url, externalURL: externalURL, summary: summary, imageURL: imageURL, bannerImageURL: bannerImageURL, datePublished: datePublished, dateModified: dateModified, authors: authors, tags: tags, attachments: attachments, accountInfo: accountInfo) self.init(account: account, articleID: articleID, feedID: feedID, uniqueID: uniqueID, title: title, contentHTML: contentHTML, contentText: contentText, url: url, externalURL: externalURL, summary: summary, imageURL: imageURL, bannerImageURL: bannerImageURL, datePublished: datePublished, dateModified: dateModified, authors: authors, tags: tags, attachments: attachments, accountInfo: accountInfo)
} }