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", "")