diff options
author | 2023-10-18 21:42:34 -0700 | |
---|---|---|
committer | 2023-10-18 22:24:56 -0700 | |
commit | 9fd2dfa6801c908ab81ea77d338c28a3c76d7f01 (patch) | |
tree | 581d92fb101780b4064176e58309f18c2ee1a845 /internal/reader/handler/handler.go | |
parent | 7650c81ad92265b82373420e17c1dd5f1abcd4bc (diff) | |
download | v2-9fd2dfa6801c908ab81ea77d338c28a3c76d7f01.tar.gz v2-9fd2dfa6801c908ab81ea77d338c28a3c76d7f01.tar.zst v2-9fd2dfa6801c908ab81ea77d338c28a3c76d7f01.zip |
Refactor icon finder
Changes:
- Continue the discovery process when the feed icon is invalid
- Search all icons from the HTML document and do not stop on the first one
Diffstat (limited to 'internal/reader/handler/handler.go')
-rw-r--r-- | internal/reader/handler/handler.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/reader/handler/handler.go b/internal/reader/handler/handler.go index 91b7e394..9ab454e3 100644 --- a/internal/reader/handler/handler.go +++ b/internal/reader/handler/handler.go @@ -241,8 +241,8 @@ func RefreshFeed(store *storage.Storage, userID, feedID int64, forceRefresh bool func checkFeedIcon(store *storage.Storage, feedID int64, websiteURL, feedIconURL, userAgent string, fetchViaProxy, allowSelfSignedCertificates bool) { if !store.HasIcon(feedID) { - icon, err := icon.FindIcon(websiteURL, feedIconURL, userAgent, fetchViaProxy, allowSelfSignedCertificates) - if err != nil { + iconFinder := icon.NewIconFinder(websiteURL, feedIconURL, userAgent, fetchViaProxy, allowSelfSignedCertificates) + if icon, err := iconFinder.FindIcon(); err != nil { slog.Warn("Unable to find feed icon", slog.Int64("feed_id", feedID), slog.String("website_url", websiteURL), |