diff --git a/subwave_nowplaying.star b/subwave_nowplaying.star index 9315c76..a3ed250 100644 --- a/subwave_nowplaying.star +++ b/subwave_nowplaying.star @@ -121,18 +121,21 @@ def main(config): art = _fetch_cover(station_url, now["subsonic_id"]) progress = _track_progress(now["subsonic_id"], now["duration"]) + # The show/host and time/temp rows always render, even when empty, so + # they hold a fixed vertical position regardless of which fields a given + # track/moment actually has data for -- rather than the layout shifting + # up when e.g. there's a show but no DJ credited, or no show at all. + show_host_row = [render.Text(now["show"], font = "tom-thumb", color = colors["text"])] + if now["host"]: + show_host_row.append(render.Text(" " + now["host"], font = "tom-thumb", color = colors["accent"])) + top_lines = [ render.Marquee(width = 32, child = render.Text(now["title"], color = colors["text"])), render.Marquee(width = 32, child = render.Text(now["artist"], color = colors["text"])), + render.Box(width = 32, height = 1, color = colors["separator"]), + render.Marquee(width = 32, child = render.Row(children = show_host_row)), + render.Marquee(width = 32, child = render.Text(now["time_temp"], font = "tom-thumb", color = colors["meta"])), ] - if now["show"]: - top_lines.append(render.Box(width = 32, height = 1, color = colors["separator"])) - show_host_row = [render.Text(now["show"], font = "tom-thumb", color = colors["text"])] - if now["host"]: - show_host_row.append(render.Text(" " + now["host"], font = "tom-thumb", color = colors["accent"])) - top_lines.append(render.Marquee(width = 32, child = render.Row(children = show_host_row))) - if now["time_temp"]: - top_lines.append(render.Marquee(width = 32, child = render.Text(now["time_temp"], font = "tom-thumb", color = colors["meta"]))) children = [render.Column(children = top_lines)] if progress != None: