Skip to content

Screensaver: wire the photo-feed picker to real sources (fixes #176) - #185

Merged
starbrightlab merged 1 commit into
mainfrom
fix/176-wire-photo-feeds
Aug 4, 2026
Merged

Screensaver: wire the photo-feed picker to real sources (fixes #176)#185
starbrightlab merged 1 commit into
mainfrom
fix/176-wire-photo-feeds

Conversation

@starbrightlab

Copy link
Copy Markdown
Owner

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. fetchWebPhoto always 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):

  • Met Museum: highlighted artworks via the keyless collection API (~950 curated works). Rights-restricted objects return blank image URLs despite the hasImages filter, so the fetcher skips up to 5 of them per tick instead of failing the whole source.
  • Art Institute of Chicago: public-domain artworks off their IIIF CDN at the guaranteed 843px width.
  • NASA APOD: one batch call for 40 random picture entries per session (video days skipped), then plain CDN downloads. This keeps the shared DEMO_KEY well under its ~30 calls/hour, ~50/day rate limit, which is why a per-photo API call was never an option.
  • Wikimedia: already implemented; picking it now actually leads with it.

Testing

  • ./gradlew :app:testDebugUnitTest green.
  • All three new APIs verified live: Met search returns 947 ids and object details carry primaryImageSmall (with one confirmed blank-URL case exercising the skip path); AIC search + IIIF URL return 200/jpeg; APOD count= returns the expected array shape.
  • Needs an on-device pass: pick each feed, confirm the frame shows that catalog.

Fixes #176.

🤖 Generated with Claude Code

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>
@starbrightlab
starbrightlab merged commit 44aaae0 into main Aug 4, 2026
3 checks passed
@starbrightlab
starbrightlab deleted the fix/176-wire-photo-feeds branch August 4, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nasa Screensaver doesn't work (non-NASA photos display)

1 participant