Add slow zoom/pan reveal to album art; fix JSON-null crash on activeShow

This commit is contained in:
poprhythm committed 2026-09-29 15:12:01 -04:00
1 parent 74be033a29
commit 27e29705c9
2 files changed
+92 -12

No files matched your search

+25 -6
View File
@@ -1,12 +1,12 @@
# subwave-nowplaying
Tronbyt/Tidbyt app showing the current track on a [SUB/WAVE](https://github.com/perminder-klair/subwave)
internet radio station: album art, and four scrolling lines — track
title/artist, a thin separator, the current show and host, and local
time/temperature — plus a track progress bar pinned to the bottom of the
32px-wide text column. Color scheme (cyan title/artist, white show name,
magenta host/progress bar) is loosely modeled on SUB/WAVE's own web
now-playing display.
internet radio station: album art with a slow zoom/pan reveal, and four
scrolling lines — track title/artist, a thin separator, the current show
and host, and local time/temperature — plus a track progress bar pinned to
the bottom of the 32px-wide text column. Color scheme (cyan title/artist,
white show name, magenta host/progress bar) is loosely modeled on SUB/WAVE's
own web now-playing display.
Not tied to any specific station — set your own station's base URL in the
app's config when adding it to a device.
@@ -28,6 +28,18 @@ app's config when adding it to a device.
instead of stale track info.
- If a track has no `subsonic_id`, or the cover fetch fails, falls back to a
full-width layout with no art rather than a broken image.
- Album art gets a slow "Ken Burns" reveal: starts zoomed into one corner of
the image, eases out to show the full frame over ~60s. Rendered oversized
(45x45 vs. the 32x32 display slot) and scaled down from 1.0 to ~0.71,
since `animation.Scale` above 1.0 has no visible effect on a widget whose
declared size already matches its container. Which corner it starts in is
derived from the track's `subsonic_id` (not true randomness) so a
still-playing track re-rendered on the `NOWPLAYING_TTL` cache doesn't
jarringly jump corners — only a genuinely new track does. Verified this
doesn't blow the payload budget: counterintuitively, a *slower* zoom
compresses *smaller*, since more adjacent ticks become pixel-identical at
this resolution and WebP dedupes them — measured 97-264KB depending on the
art's own visual complexity, all well under the 460KB device limit.
- Shows the current show name (`context.activeShow.name`) and host name
(`dj.name`) below the artist, separated by a thin divider line, and the
local time/temperature (`context.clock`/`context.weather`) below that —
@@ -62,6 +74,13 @@ long-lived server process with a persistent cache (true for
invocation always starts a fresh process with an empty cache, so the bar
will always show 0% when testing locally. This is expected, not a bug.
**Note on JSON nulls:** SUB/WAVE sends some fields as explicit JSON `null`
(e.g. `context.activeShow` between scheduled shows) rather than omitting the
key. Starlark's `dict.get(key, default)` only falls back to `default` when
the key is *absent* — an explicit `null` (decoded to Starlark `None`) passes
straight through, so this app also does `... or {}` on those lookups before
chaining another `.get()` off them, to avoid a `NoneType has no .get` crash.
**Note on unreachable hosts:** if the station URL is wrong or the host is
completely unreachable (DNS failure, connection refused), `http.get` raises
a hard error and the render fails for that cycle — this is normal pixlet/
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.