Remove attachments from the app, since we’re not using attachments in any way. We could always add it back later.

This commit is contained in:
Brent Simmons
2019-12-03 23:03:15 -08:00
parent e137dca5e3
commit 3ead2c63bc
15 changed files with 10 additions and 266 deletions

View File

@@ -121,7 +121,6 @@ private extension ArticlePasteboardWriter {
static let starred = "starred"
static let userDeleted = "userDeleted"
static let authors = "authors"
static let attachments = "attachments"
// Author
static let authorName = "name"
@@ -129,13 +128,6 @@ private extension ArticlePasteboardWriter {
static let authorAvatarURL = "avatarURL"
static let authorEmailAddress = "emailAddress"
// Attachment
static let attachmentURL = "url"
static let attachmentMimeType = "mimeType"
static let attachmentTitle = "title"
static let attachmentSizeInBytes = "sizeInBytes"
static let attachmentDurationInSeconds = "durationInSeconds"
// Internal
static let accountID = "accountID"
}
@@ -163,7 +155,6 @@ private extension ArticlePasteboardWriter {
d[Key.dateModified] = article.dateModified ?? nil
d[Key.dateArrived] = article.status.dateArrived
d[Key.authors] = authorDictionaries() ?? nil
d[Key.attachments] = attachmentDictionaries() ?? nil
return d
}
@@ -182,19 +173,6 @@ private extension ArticlePasteboardWriter {
d[Key.authorAvatarURL] = author.avatarURL ?? nil
d[Key.authorEmailAddress] = author.emailAddress ?? nil
return d
}
func attachmentDictionary(_ attachment: Attachment) -> [String: Any] {
var d = [String: Any]()
d[Key.attachmentURL] = attachment.url
d[Key.attachmentMimeType] = attachment.mimeType ?? nil
d[Key.attachmentTitle] = attachment.title ?? nil
d[Key.attachmentSizeInBytes] = attachment.sizeInBytes ?? nil
d[Key.attachmentDurationInSeconds] = attachment.durationInSeconds ?? nil
return d
}
@@ -204,12 +182,5 @@ private extension ArticlePasteboardWriter {
}
return authors.map{ authorDictionary($0) }
}
func attachmentDictionaries() -> [[String: Any]]? {
guard let attachments = article.attachments, !attachments.isEmpty else {
return nil
}
return attachments.map { attachmentDictionary($0) }
}
}

View File

@@ -549,7 +549,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr
let longTitle = "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"
let prototypeID = "prototype"
let status = ArticleStatus(articleID: prototypeID, read: false, starred: false, userDeleted: false, dateArrived: Date())
let prototypeArticle = Article(accountID: prototypeID, articleID: prototypeID, feedID: prototypeID, uniqueID: prototypeID, title: longTitle, contentHTML: nil, contentText: nil, url: nil, externalURL: nil, summary: nil, imageURL: nil, bannerImageURL: nil, datePublished: nil, dateModified: nil, authors: nil, attachments: nil, status: status)
let prototypeArticle = Article(accountID: prototypeID, articleID: prototypeID, feedID: prototypeID, uniqueID: prototypeID, title: longTitle, contentHTML: nil, contentText: nil, url: nil, externalURL: nil, summary: nil, imageURL: nil, bannerImageURL: nil, datePublished: nil, dateModified: nil, authors: nil, status: status)
let prototypeCellData = TimelineCellData(article: prototypeArticle, showFeedName: showingFeedNames, feedName: "Prototype Feed Name", avatar: nil, showAvatar: false, featuredImage: nil)
let height = TimelineCellLayout.height(for: 100, cellData: prototypeCellData, appearance: cellAppearance)