Make progress on saving updated articles.

This commit is contained in:
Brent Simmons
2017-09-08 13:36:30 -07:00
parent 9ee20ee270
commit f40b400dd5
4 changed files with 70 additions and 82 deletions

View File

@@ -13,7 +13,7 @@ import RSParser
extension Article {
convenience init?(row: FMResultSet, authors: Set<Author>, attachments: Set<Attachment>, tags: Set<String>, accountID: String) {
init?(row: FMResultSet, authors: Set<Author>, attachments: Set<Attachment>, tags: Set<String>, accountID: String) {
guard let feedID = row.string(forColumn: DatabaseKey.feedID) else {
return nil
@@ -38,7 +38,7 @@ extension Article {
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)
}
convenience init(parsedItem: ParsedItem, accountID: String, feedID: String) {
init(parsedItem: ParsedItem, accountID: String, feedID: String) {
let authors = Author.authorsWithParsedAuthors(parsedItem.authors)
let attachments = Attachment.attachmentsWithParsedAttachments(parsedItem.attachments)

View File

@@ -34,7 +34,7 @@ extension Author {
return nil
}
let authors = parsedAuthors.flatMap { Author(parsedAuthor: $0) }
let authors = Set(parsedAuthors.flatMap { Author(parsedAuthor: $0) })
return authors.isEmpty ? nil : authors
}
}