Make attachments use a DatabaseLookupTable.

This commit is contained in:
Brent Simmons
2017-08-20 17:46:15 -07:00
parent 213b1d7a6f
commit c164c29cde
13 changed files with 77 additions and 320 deletions

View File

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

View File

@@ -18,7 +18,7 @@ public struct Author: Hashable {
public let emailAddress: String?
public let hashValue: Int
public init?(databaseID: String?, name: String?, url: String?, avatarURL: String?, emailAddress: String?) {
public init?(authorID: String?, name: String?, url: String?, avatarURL: String?, emailAddress: String?) {
if name == nil && url == nil && emailAddress == nil {
return nil
@@ -34,11 +34,11 @@ public struct Author: Hashable {
s += emailAddress ?? ""
self.hashValue = s.hashValue
if let databaseID = databaseID {
self.databaseID = databaseID
if let authorID = authorID {
self.authorID = authorID
}
else {
self.databaseID = databaseIDWithString(s)
self.authorID = databaseIDWithString(s)
}
}