From d83e099d2c0b56adc8677b64e5ff8283b01c03c0 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 15 Dec 2024 10:59:43 -0800 Subject: [PATCH] Remove remainder of featured image code (which is unused). --- Mac/MainWindow/Timeline/Cell/TimelineCellData.swift | 7 ++----- Mac/MainWindow/Timeline/TimelineViewController.swift | 4 ++-- Shared/Images/RSHTMLMetadata+Extension.swift | 9 --------- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/Mac/MainWindow/Timeline/Cell/TimelineCellData.swift b/Mac/MainWindow/Timeline/Cell/TimelineCellData.swift index 53bb79adb..1b2dd91d9 100644 --- a/Mac/MainWindow/Timeline/Cell/TimelineCellData.swift +++ b/Mac/MainWindow/Timeline/Cell/TimelineCellData.swift @@ -22,11 +22,10 @@ struct TimelineCellData { let showFeedName: TimelineShowFeedName let iconImage: IconImage? // feed icon, user avatar, or favicon let showIcon: Bool // Make space even when icon is nil - let featuredImage: NSImage? // image from within the article let read: Bool let starred: Bool - init(article: Article, showFeedName: TimelineShowFeedName, feedName: String?, byline: String?, iconImage: IconImage?, showIcon: Bool, featuredImage: NSImage?) { + init(article: Article, showFeedName: TimelineShowFeedName, feedName: String?, byline: String?, iconImage: IconImage?, showIcon: Bool) { self.title = ArticleStringFormatter.truncatedTitle(article) self.attributedTitle = ArticleStringFormatter.attributedTruncatedTitle(article) @@ -56,8 +55,7 @@ struct TimelineCellData { self.showIcon = showIcon self.iconImage = iconImage - self.featuredImage = featuredImage - + self.read = article.status.read self.starred = article.status.starred } @@ -71,7 +69,6 @@ struct TimelineCellData { self.showFeedName = .none self.showIcon = false self.iconImage = nil - self.featuredImage = nil self.read = true self.starred = false self.attributedTitle = NSAttributedString() diff --git a/Mac/MainWindow/Timeline/TimelineViewController.swift b/Mac/MainWindow/Timeline/TimelineViewController.swift index 02afa0ae7..8d194ea26 100644 --- a/Mac/MainWindow/Timeline/TimelineViewController.swift +++ b/Mac/MainWindow/Timeline/TimelineViewController.swift @@ -726,7 +726,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr let status = ArticleStatus(articleID: prototypeID, read: false, starred: false, dateArrived: Date()) let prototypeArticle = Article(accountID: prototypeID, articleID: prototypeID, webFeedID: prototypeID, uniqueID: prototypeID, title: longTitle, contentHTML: nil, contentText: nil, url: nil, externalURL: nil, summary: nil, imageURL: nil, datePublished: nil, dateModified: nil, authors: nil, status: status) - let prototypeCellData = TimelineCellData(article: prototypeArticle, showFeedName: .feed, feedName: "Prototype Feed Name", byline: nil, iconImage: nil, showIcon: false, featuredImage: nil) + let prototypeCellData = TimelineCellData(article: prototypeArticle, showFeedName: .feed, feedName: "Prototype Feed Name", byline: nil, iconImage: nil, showIcon: false) let height = TimelineCellLayout.height(for: 100, cellData: prototypeCellData, appearance: cellAppearance) return height } @@ -879,7 +879,7 @@ extension TimelineViewController: NSTableViewDelegate { private func configureTimelineCell(_ cell: TimelineTableCellView, article: Article) { cell.objectValue = article let iconImage = article.iconImage() - cell.cellData = TimelineCellData(article: article, showFeedName: showFeedNames, feedName: article.webFeed?.nameForDisplay, byline: article.byline(), iconImage: iconImage, showIcon: showIcons, featuredImage: nil) + cell.cellData = TimelineCellData(article: article, showFeedName: showFeedNames, feedName: article.webFeed?.nameForDisplay, byline: article.byline(), iconImage: iconImage, showIcon: showIcons) } private func iconFor(_ article: Article) -> IconImage? { diff --git a/Shared/Images/RSHTMLMetadata+Extension.swift b/Shared/Images/RSHTMLMetadata+Extension.swift index 82580ab37..05970cf40 100644 --- a/Shared/Images/RSHTMLMetadata+Extension.swift +++ b/Shared/Images/RSHTMLMetadata+Extension.swift @@ -86,13 +86,4 @@ extension RSHTMLMetadata { return twitterProperties.imageURL } - - func bestFeaturedImageURL() -> String? { - - if let openGraphImageURL = largestOpenGraphImageURL() { - return openGraphImageURL - } - - return twitterProperties.imageURL - } }