feat: bundled default artwork + artwork in the UI #3

Merged
w33ble merged 5 commits from feat/artwork-ui into main 2026-09-06 19:17:35 -06:00
Collaborator

What

Feed artwork, end to end: a real bundled logo, per-Episode thumbnails in the UI, and header art.

  • Bundled default artwork: media/mediacast_512.png (512×512 PNG) is embedded via a small media package and served at /artwork.png when MEDIACAST_ARTWORK is unset; the old placeholder is gone. Override semantics unchanged: set-but-missing path → 404, any container-readable filesystem path works.
  • Content type by file: handleArtwork now uses http.ServeContent — the file's extension drives the type (.jpg → image/jpeg, .png → image/png) with DetectContentType fallback; If-Modified-Since and HEAD come free.
  • UI art: feed art in the header (48px) + per-Episode thumbnails on done rows (40px, lazy-loaded). Thumbnails use the Episode's stored ArtURL; empty → /artwork.png fallback. Queued/processing/failed rows render no thumbnail.

Tests

New internal/server/artwork_test.go (bundled default serves PNG, extension-driven override type, missing override → 404) plus page tests for header art, ArtURL thumbs, no-art fallback, lazy loading, and no-thumb on non-done rows. Existing artwork/feed assertions flipped from JPEG to PNG. mise run check + mise run test green.

Closes MCAST-15.

## What Feed artwork, end to end: a real bundled logo, per-Episode thumbnails in the UI, and header art. - **Bundled default artwork**: `media/mediacast_512.png` (512×512 PNG) is embedded via a small `media` package and served at `/artwork.png` when `MEDIACAST_ARTWORK` is unset; the old placeholder is gone. Override semantics unchanged: set-but-missing path → 404, any container-readable filesystem path works. - **Content type by file**: `handleArtwork` now uses `http.ServeContent` — the file's extension drives the type (`.jpg` → image/jpeg, `.png` → image/png) with `DetectContentType` fallback; `If-Modified-Since` and HEAD come free. - **UI art**: feed art in the header (48px) + per-Episode thumbnails on done rows (40px, lazy-loaded). Thumbnails use the Episode's stored `ArtURL`; empty → `/artwork.png` fallback. Queued/processing/failed rows render no thumbnail. ## Tests New `internal/server/artwork_test.go` (bundled default serves PNG, extension-driven override type, missing override → 404) plus page tests for header art, `ArtURL` thumbs, no-art fallback, lazy loading, and no-thumb on non-done rows. Existing artwork/feed assertions flipped from JPEG to PNG. `mise run check` + `mise run test` green. Closes MCAST-15.
The bundled placeholder moves out of internal/server/ and into media/ — the directory is now the source of truth for the embedded asset. Rename mediacast.png to mediacast.jpg (the bytes were already JPEG; the .png was a misnomer). Embed via a small media package so the binary stays self-contained. handleArtwork now uses http.ServeContent for both the bundled default and the MEDIACAST_ARTWORK override, so content-type follows the file (extension lookup falls through to DetectContentType for unknown formats). Old 300x300 internal/server/artwork.png is gone.
Header gains a 48px feed-art tile (rounded, framed) to the left of the title; done rows render a 40px episode thumbnail before the title, sourced from the Episode ArtURL with /artwork.png as the fallback when ArtURL is empty. Loading="lazy" on the per-episode imgs so long lists don't blow the viewport budget. Header layout switches from flex+baseline to a 3-column grid so the image aligns with the title vertically; the narrow-viewport media query is updated to keep the link below the title row when space runs out.
Bundled default serves as image/jpeg with the JFIF signature and ~53KB body. MEDIACAST_ARTWORK override: png extension maps to image/png (extension lookup wins over the body content), missing file 404s (no fallback to bundled). Page header contains the feed-art img. Done rows render ArtURL; NoArt fake falls back to /artwork.png. Episode thumbnails carry loading=lazy. Queued and failed rows do not render an ep-thumb at all.
docs: bundled artwork lives at media/mediacast.jpg
Some checks failed
ci / check (pull_request) Has been cancelled
1add426e17
README wording change for the MEDIACAST_ARTWORK row: bundled default is now media/mediacast.jpg (1024x1024 JPEG) instead of the old 300x300 internal/server/artwork.png placeholder. The rest of the override semantics (any container-readable path; missing file is 404) are unchanged.
fix: new logo as bundled artwork
All checks were successful
ci / check (pull_request) Successful in 4m8s
de1ae66daf
Replace the JPEG-as-PNG placeholder with a real 512x512 PNG: media/mediacast.jpg is gone, media/mediacast_512.png is in. media/media.go embed + DefaultArtwork helper and artwork.go's bundledArtworkName are updated to match. http.ServeContent picks up image/png from the .png extension, so the handler is unchanged. Tests assert PNG signature + image/png + the new byte size; README MEDIACAST_ARTWORK row points at the new file.
w33ble changed target branch from feat/delete-control to main 2026-09-06 19:13:54 -06:00
hijynx force-pushed feat/artwork-ui from de1ae66daf
All checks were successful
ci / check (pull_request) Successful in 4m8s
to dc81f1f804
All checks were successful
ci / check (pull_request) Successful in 1m1s
2026-09-06 19:15:27 -06:00
Compare
w33ble approved these changes 2026-09-06 19:16:13 -06:00
w33ble merged commit 29c9ea2244 into main 2026-09-06 19:17:35 -06:00
w33ble deleted branch feat/artwork-ui 2026-09-06 19:17:35 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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
w33ble/mediacast!3
No description provided.