mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-24 00:30:51 +01:00
Base the homePageURL for a feed from its feed URL when looking for its favicon. When necessary only.
This commit is contained in:
parent
3eb95ce63d
commit
b3ecf9cdba
@ -47,10 +47,18 @@ final class FaviconDownloader {
|
||||
return favicon(with: faviconURL)
|
||||
}
|
||||
|
||||
guard let homePageURL = feed.homePageURL else {
|
||||
return nil
|
||||
var homePageURL = feed.homePageURL
|
||||
if homePageURL == nil {
|
||||
// Base homePageURL off feedURL if needed. Won’t always be accurate, but is good enough.
|
||||
if let feedURL = URL(string: feed.url), let scheme = feedURL.scheme, let host = feedURL.host {
|
||||
homePageURL = scheme + "://" + host + "/"
|
||||
}
|
||||
}
|
||||
return favicon(withHomePageURL: homePageURL)
|
||||
if let homePageURL = homePageURL {
|
||||
return favicon(withHomePageURL: homePageURL)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func favicon(with faviconURL: String) -> NSImage? {
|
||||
|
Loading…
Reference in New Issue
Block a user