A feed with no artwork takes its site's icon (#70)

When a feed names no image and none is stored, the scan fetches the
channel's site link (RSS <link>, Atom rel=alternate) and uses the
apple-touch-icon or icon it names, falling back to /favicon.ico when that
answers with an image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-28 23:18:46 +00:00
parent f57f824535
commit ce221cee18
3 changed files with 79 additions and 1 deletions

View File

@@ -1205,7 +1205,15 @@ async fn scan_one(
return sync_opml(ctx, id, feed_cfg, &bytes).await;
}
let parsed = feed::parse(&bytes)?;
let mut parsed = feed::parse(&bytes)?;
// ponytail: a site with no icon at all is asked again on every scan that finds the feed
// changed; remember the miss in the feeds table if that turns out to cost.
if parsed.image.is_none()
&& let Some(site) = &parsed.site
&& ctx.db.feed_summary(id).await?.image.is_none()
{
parsed.image = feed::site_icon(&ctx.client, site).await;
}
ctx.db.record_feed(
id,
&feed_cfg.url,