Rotate the random zoom spot over time, not just per-track

Random zoom position was previously picked once per track (stable via
subsonic_id) and held for that track's entire runtime. Changed it to
rotate on a ~10s cadence based on wall-clock time, still offset by a
per-track hash so different tracks don't all land on the same spot in
the same window. This lets a single long track show off different
sections of its own artwork over time, rather than being stuck on one
spot until the next track starts.
This commit is contained in:
poprhythm committed 2026-10-02 22:19:59 -04:00
1 parent d8add24c5e
commit f6893bdcdf
2 files changed
+43 -21

No files matched your search

+19 -9
View File
@@ -24,8 +24,12 @@ app's config when adding it to a device.
- **Album art zoom** — how far the album art's breathing zoom effect goes
in: Off, Subtle, Moderate (default), or Strong.
- **Zoom position** — where the zoom centers on: Center (default), or
Random (a handful of preset off-center spots, picked per-track so a
still-playing track doesn't jump between spots on every refresh).
Random (a handful of preset off-center spots). Rotates on a ~10s cadence
based on wall-clock time, offset per-track so different tracks don't all
land on the same spot at the same moment — meaning it can change on
*every* refresh, not just when the track changes, so a long track gets
to show off different sections of its art over time instead of being
stuck on one spot for its whole runtime.
## How it works
@@ -55,13 +59,19 @@ app's config when adding it to a device.
came from testing it set to its own default value and comparing the
result against itself, which is of course identical either way). The
"Random" zoom position picks from a handful of preset off-center spots
(`ZOOM_RANDOM_SPOTS`), chosen per-track from `subsonic_id` the same way
the old corner-selection logic worked, so a still-playing track doesn't
jump between spots on every `NOWPLAYING_TTL` refresh. Those spots are
kept modest (0.3-0.7 of the image's own bounds, not the full 0.0-1.0
range) and verified safe (no black border, even at the strongest 1.7x
zoom) via the calibration tool; more extreme corners weren't tested and
may not be safe.
(`ZOOM_RANDOM_SPOTS`), kept modest (0.3-0.7 of the image's own bounds,
not the full 0.0-1.0 range) and verified safe (no black border, even at
the strongest 1.7x zoom) via the calibration tool; more extreme corners
weren't tested and may not be safe. Which spot is picked rotates on a
`ZOOM_SPOT_ROTATE_SECONDS` (10s) cadence based on wall-clock time
(`time.now().unix`), offset by a hash of `subsonic_id` so different
tracks don't all land on the same spot in the same 10s window. This was
deliberately *not* made purely per-track-stable (i.e. the same spot for
a track's entire runtime, the way the old corner-selection logic for
the since-removed Translate approach worked): the ask was to see
different sections of a single piece of art over time, which requires
the spot to be able to change mid-playback, not just when the track
changes.
An earlier version tried to fix a *different* problem — `animation.Scale`
zooming in asymmetrically toward one corner — by pairing Scale with a
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.