mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Remove no-longer-needed downloadMetadata delegate method.
This commit is contained in:
@@ -21,8 +21,6 @@ public extension Notification.Name {
|
||||
public protocol FaviconDownloaderDelegate {
|
||||
|
||||
@MainActor var appIconImage: IconImage? { get }
|
||||
|
||||
@MainActor func downloadMetadata(_ url: String) async throws -> HTMLMetadata?
|
||||
}
|
||||
|
||||
@MainActor public final class FaviconDownloader {
|
||||
@@ -228,7 +226,7 @@ private extension FaviconDownloader {
|
||||
guard let url = URL(string: homePageURL) else {
|
||||
return nil
|
||||
}
|
||||
guard let faviconURLs = await FaviconURLFinder.findFaviconURLs(with: homePageURL, downloadMetadata: delegate!.downloadMetadata(_:)) else {
|
||||
guard let faviconURLs = await FaviconURLFinder.findFaviconURLs(with: homePageURL) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -22,14 +22,14 @@ import UniformTypeIdentifiers
|
||||
/// - Parameters:
|
||||
/// - homePageURL: The page to search.
|
||||
/// - urls: An array of favicon URLs as strings.
|
||||
static func findFaviconURLs(with homePageURL: String, downloadMetadata: ((String) async throws -> HTMLMetadata?)) async -> [String]? {
|
||||
static func findFaviconURLs(with homePageURL: String) async -> [String]? {
|
||||
|
||||
guard let _ = URL(string: homePageURL) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
// If the favicon has an explicit type, check that for an ignored type; otherwise, check the file extension.
|
||||
let htmlMetadata = try? await downloadMetadata(homePageURL)
|
||||
let htmlMetadata = await HTMLMetadataDownloader.downloadMetadata(for: homePageURL)
|
||||
|
||||
let faviconURLs = htmlMetadata?.favicons?.compactMap { favicon -> String? in
|
||||
shouldAllowFavicon(favicon) ? favicon.urlString : nil
|
||||
|
||||
@@ -17,11 +17,6 @@ extension AppDelegate: FaviconDownloaderDelegate, FeedIconDownloaderDelegate {
|
||||
IconImage.appIcon
|
||||
}
|
||||
|
||||
func downloadMetadata(_ url: String) async throws -> HTMLMetadata? {
|
||||
|
||||
await HTMLMetadataDownloader.downloadMetadata(for: url)
|
||||
}
|
||||
|
||||
func initializeDownloaders() {
|
||||
|
||||
FaviconDownloader.shared.delegate = self
|
||||
|
||||
Reference in New Issue
Block a user