Fall back to other instances when a channel avatar fails #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "avatar-instance-fallback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Channel avatars, most visibly in channel search results, often stayed as letter placeholders. An avatar URL names whichever instance served the page, and it was the only URL ever tried, so a flaky or since-removed instance meant no avatar. Video thumbnails already fell back across instances; avatars did not.
Changes
avatar_urls(configured, url), exported over UniFFI likethumbnail_urls. It returns the original URL, then the same/ggpht/...image on each configured instance in failover order (yt3.ggpht.comfor Direct YouTube). It also handles raw YouTube image-CDN URLs and thehttps,http://...form.cache_channel_avatarand the feed-sync avatar prefetch try those candidates in order.cache_channel_avatarnow takes the instance list; Adwaita is its only caller..jpg, shadow the real avatar, and stop the failover.fetch_first.AvatarImagecomposable steps throughavatarUrlscandidates on load error, with the instances from aLocalInstanceBaseUrlsprovided inAppRoot. Used for channel avatars in search, channel pages, subscriptions, Shorts, the watch page and TV browse, and for comment avatars.Testing
cargo testin invio-core: 578 passed, including 2 newavatar_urlstests.cargo checkpasses for invio-server and invio-adwaita.:app:compileDebugKotlinpasses against freshly generated bindings;InvidiousInstancesTest(8 tests, including a newavatarUrlstest against the real core) passes.Not covered
macOS loads avatar URLs directly and doesn't use this fallback yet.