From f3f31448cc33c4f82ddf34e515c36720d3fd5a59 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 14 Oct 2024 22:51:04 -0700 Subject: [PATCH] =?UTF-8?q?Reference=20HTMLMetadataDownloader.downloadMeta?= =?UTF-8?q?data=20directly=20now=20that=20it=E2=80=99s=20in=20the=20same?= =?UTF-8?q?=20module.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Modules/Images/Sources/Images/FeedIconDownloader.swift | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Modules/Images/Sources/Images/FeedIconDownloader.swift b/Modules/Images/Sources/Images/FeedIconDownloader.swift index c833531ae..3147ea6d5 100644 --- a/Modules/Images/Sources/Images/FeedIconDownloader.swift +++ b/Modules/Images/Sources/Images/FeedIconDownloader.swift @@ -21,8 +21,6 @@ public extension Notification.Name { public protocol FeedIconDownloaderDelegate: Sendable { @MainActor var appIconImage: IconImage? { get } - - func downloadMetadata(_ url: String) async throws -> HTMLMetadata? } @MainActor public final class FeedIconDownloader { @@ -167,7 +165,6 @@ public protocol FeedIconDownloaderDelegate: Sendable { saveHomePagesWithNoIconURLCache() } } - } private extension FeedIconDownloader { @@ -182,7 +179,7 @@ private extension FeedIconDownloader { return await icon(forURL: iconURL, feed: feed) } - findIconURLForHomePageURL(homePageURL, feed: feed, downloadMetadata: delegate!.downloadMetadata(_:)) + findIconURLForHomePageURL(homePageURL, feed: feed) return nil } @@ -217,7 +214,7 @@ private extension FeedIconDownloader { homePageToIconURLCacheDirty = true } - func findIconURLForHomePageURL(_ homePageURL: String, feed: Feed, downloadMetadata: @escaping (String) async throws -> HTMLMetadata?) { + func findIconURLForHomePageURL(_ homePageURL: String, feed: Feed) { guard !urlsInProgress.contains(homePageURL) else { return @@ -226,7 +223,7 @@ private extension FeedIconDownloader { Task { @MainActor in - let metadata = try? await downloadMetadata(homePageURL) + let metadata = await HTMLMetadataDownloader.downloadMetadata(for: homePageURL) self.urlsInProgress.remove(homePageURL) guard let metadata else {