feat: Add support for specifying cli spotify image size
All checks were successful
Build Docker / BuildImage (push) Successful in 1m9s
Check Code Quality / RuffCheck (push) Successful in 1m19s

This commit is contained in:
2026-03-18 23:08:13 +11:00
parent 1bc3d3e15d
commit 968d9587b6
3 changed files with 7 additions and 3 deletions

View File

@@ -106,9 +106,12 @@ def callback():
def currently_playing():
"""Public endpoint showing your current track."""
track = get_playing_spotify_track()
# Get terminal width for ASCII art scaling
width = request.args.get("width", default=40, type=int)
if isCLI(request):
if "album_art" in track:
track["ascii_art"] = image_url_to_ascii(track["album_art"], new_width=40)
track["ascii_art"] = image_url_to_ascii(track["album_art"], new_width=width)
return render_template("spotify.ascii", track=track)
# Render a simple HTML page for browsers