From 887dbc7183f8e9a25ab2ecedfcc2ba8a6bfb3ba4 Mon Sep 17 00:00:00 2001 From: jim kolpack Date: Sat, 10 Oct 2026 16:54:09 -0400 Subject: [PATCH] Show album and year at 2x, below the artist line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New "album_year" field on the now-playing fetch, formatted as "Album · Year" (either half omitted if absent). 2x only, same reasoning as the show/host split and the time/temp de-marquee -- no spare row for it at 1x's tighter layout. Marquee, not a centered static line like the DJ name/time_temp: album titles can run as long as track titles, so there's no "assumed short enough to just fit" case here the way there was for those. Verified: renders between artist and the separator, no vertical overflow: title/artist/album/separator/show/host/time all fit within the available height with the progress bar still visible below. 1x unaffected (no album line, unchanged layout). --- subwave_nowplaying.star | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/subwave_nowplaying.star b/subwave_nowplaying.star index 7986320..b99c910 100644 --- a/subwave_nowplaying.star +++ b/subwave_nowplaying.star @@ -311,9 +311,21 @@ def main(config): [render.Marquee(width = text_width, child = render.Row(children = show_host_row))] ) + # Album/year only at 2x -- there's no spare row for it at 1x's tighter + # layout, same reasoning as the show/host split above. Marquee, not a + # centered static line like host/time_temp: album titles can run as + # long as track titles, so there's no "assumed short" case here to + # justify skipping it. + album_year_lines = ( + [render.Marquee(width = text_width, child = render.Text(now["album_year"], font = "tom-thumb", color = colors["meta"]))] + if scale == 2 else + [] + ) + top_lines = [ render.Marquee(width = text_width, child = render.Text(now["title"], font = title_font, color = colors["text"])), render.Marquee(width = text_width, child = render.Text(now["artist"], font = "tb-8", color = colors["text"])), + ] + album_year_lines + [ render.Box(width = text_width, height = 1, color = colors["separator"]), # kept at a crisp 1px at every scale, per request, rather than growing to match ] + show_lines + [time_temp_line] @@ -950,9 +962,18 @@ def _fetch_now_playing(station_url): "show": active_show.get("name", ""), "host": dj.get("name", ""), "time_temp": _format_time_temp(context.get("clock", {}) or {}, context.get("weather", {}) or {}), + "album_year": _format_album_year(np.get("album", ""), np.get("year", None)), "online": bool(data.get("streamOnline", False)), } +def _format_album_year(album, year): + parts = [] + if album: + parts.append(album) + if year: + parts.append(str(int(year))) + return " · ".join(parts) + def _format_time_temp(clock, weather): parts = [] display_time = clock.get("display", "")