diff --git a/Articles/Sources/Articles/Article.swift b/Articles/Sources/Articles/Article.swift index 275085eef..6876ce115 100644 --- a/Articles/Sources/Articles/Article.swift +++ b/Articles/Sources/Articles/Article.swift @@ -10,7 +10,7 @@ import Foundation public typealias ArticleSetBlock = (Set
) -> Void -public struct Article: Hashable { +public final class Article: Hashable { public let articleID: String // Unique database ID (possibly sync service ID) public let accountID: String diff --git a/ArticlesDatabase/Sources/ArticlesDatabase/Extensions/Article+Database.swift b/ArticlesDatabase/Sources/ArticlesDatabase/Extensions/Article+Database.swift index 150ff4c8c..48063d9d5 100644 --- a/ArticlesDatabase/Sources/ArticlesDatabase/Extensions/Article+Database.swift +++ b/ArticlesDatabase/Sources/ArticlesDatabase/Extensions/Article+Database.swift @@ -14,7 +14,7 @@ import RSParser extension Article { - init?(accountID: String, row: FMResultSet, status: ArticleStatus) { + convenience init?(accountID: String, row: FMResultSet, status: ArticleStatus) { guard let articleID = row.string(forColumn: DatabaseKey.articleID) else { assertionFailure("Expected articleID.") return nil @@ -41,7 +41,7 @@ extension Article { self.init(accountID: accountID, articleID: articleID, feedID: feedID, uniqueID: uniqueID, title: title, contentHTML: contentHTML, contentText: contentText, url: url, externalURL: externalURL, summary: summary, imageURL: imageURL, datePublished: datePublished, dateModified: dateModified, authors: nil, status: status) } - init(parsedItem: ParsedItem, maximumDateAllowed: Date, accountID: String, feedID: String, status: ArticleStatus) { + convenience init(parsedItem: ParsedItem, maximumDateAllowed: Date, accountID: String, feedID: String, status: ArticleStatus) { let authors = Author.authorsWithParsedAuthors(parsedItem.authors) // Deal with future datePublished and dateModified dates.