Use stale poster cache as an offline fallback (#64) #66

Merged
albert merged 1 commit from u/albert/64/youtube-image-cache into main 2026-06-21 02:36:11 +00:00
Owner

The poster/thumbnail disk cache discarded entries once they aged past
the 6h TTL, so a fetch was attempted and, when offline, fell back to a
placeholder. A device offline longer than the TTL kept its playlist
(which already has a stale fallback) but lost every cached thumbnail.

Mirror the playlist metadata cache: report cache freshness, attempt a
fresh fetch on a stale/missing entry, and serve stale bytes when the
fetch fails. The fresh/stale/fetch decision is factored into a pure
resolve_remote() with unit tests.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Fixes #64

The poster/thumbnail disk cache discarded entries once they aged past the 6h TTL, so a fetch was attempted and, when offline, fell back to a placeholder. A device offline longer than the TTL kept its playlist (which already has a stale fallback) but lost every cached thumbnail. Mirror the playlist metadata cache: report cache freshness, attempt a fresh fetch on a stale/missing entry, and serve stale bytes when the fetch fails. The fresh/stale/fetch decision is factored into a pure resolve_remote() with unit tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Fixes #64
Use stale poster cache as an offline fallback (#64)
All checks were successful
CI / ShellCheck (pull_request) Successful in 8s
CI / CI image (pull_request) Successful in 22s
CI / Rustfmt (pull_request) Successful in 13s
CI / Clippy (pull_request) Successful in 2m23s
CI / Android portability (shepherd-media-core) (pull_request) Successful in 28s
CI / Test (pull_request) Successful in 2m58s
CI / Build (pull_request) Successful in 3m3s
CI / E2E (pull_request) Successful in 3m19s
CI / Firewall E2E (pull_request) Successful in 4m2s
69ff2f1353
The poster/thumbnail disk cache discarded entries once they aged past
the 6h TTL, so a fetch was attempted and, when offline, fell back to a
placeholder. A device offline longer than the TTL kept its playlist
(which already has a stale fallback) but lost every cached thumbnail.

Mirror the playlist metadata cache: report cache freshness, attempt a
fresh fetch on a stale/missing entry, and serve stale bytes when the
fetch fails. The fresh/stale/fetch decision is factored into a pure
resolve_remote() with unit tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
albert merged commit 4c020c7821 into main 2026-06-21 02:36:11 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
albert/shepherd-launcher!66
No description provided.