Screensaver: wire the photo-feed picker to real sources (fixes #176) - #185
Merged
Conversation
The "Photo feed" setting offered five choices but nothing ever read it — fetchWebPhoto always walked the hardcoded picsum→wikimedia→bundled chain, so picking "NASA Astronomy Picture" (or The Met, or Art Institute) silently showed random Picsum stock photos instead. Now the chosen feed leads the fetch chain, with the default chain kept behind it as the never-blank fallback: - Met Museum: highlighted artworks via the keyless collection API; one search per session, then a small object-detail fetch + image download per photo. Rights-restricted objects (blank image URLs behind the hasImages filter) are skipped instead of failing the source. - Art Institute of Chicago: public-domain artworks off their IIIF CDN at the guaranteed 843px width; one catalog fetch per session. - NASA APOD: one batch call for 40 random picture entries per session (video days skipped), then plain CDN downloads — keeps the shared DEMO_KEY well under its ~30 calls/hour rate limit. - Wikimedia: already implemented; picking it now actually leads with it. A feed change mid-session takes effect on the next photo (the chain is built per fetch). All three APIs verified live against their current responses. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem (issue #176)
The "Photo feed" setting offered five choices (Picsum, The Met, Art Institute, Wikimedia, NASA APOD) and the settings registry rendered the picker on-device and on the remote, but nothing ever read the stored value.
fetchWebPhotoalways walked the hardcoded picsum -> wikimedia -> bundled chain, so picking "NASA Astronomy Picture" silently showed random Picsum stock photos. Every choice was decorative.Fix
The chosen feed now leads the fetch chain, with the default chain kept behind it as the never-blank fallback (
chosenFeedSource()+ per-fetch chain assembly, so a settings change takes effect on the next photo without a restart).New fetchers, all following the existing wikimedia pattern (one catalog fetch per session, then plain image downloads, 5-minute cooldown on failure):
hasImagesfilter, so the fetcher skips up to 5 of them per tick instead of failing the whole source.DEMO_KEYwell under its ~30 calls/hour, ~50/day rate limit, which is why a per-photo API call was never an option.Testing
./gradlew :app:testDebugUnitTestgreen.primaryImageSmall(with one confirmed blank-URL case exercising the skip path); AIC search + IIIF URL return 200/jpeg; APODcount=returns the expected array shape.Fixes #176.
🤖 Generated with Claude Code