Fallback to album art when no track image

This commit is contained in:
krateng 2023-12-27 16:11:03 +01:00
parent fd4c99f888
commit 8e06c34323

View File

@ -284,6 +284,12 @@ def image_request(artist_id=None,track_id=None,album_id=None):
if result is not None:
# we got an entry, even if it's that there is no image (value None)
if result['value'] is None:
# fallback to album regardless of setting (because we have no image)
if track_id:
track = database.sqldb.get_track(track_id)
if track.get("album"):
album_id = database.sqldb.get_album_id(track["album"])
return image_request(album_id=album_id)
# use placeholder
if malojaconfig["FANCY_PLACEHOLDER_ART"]:
placeholder_url = "https://generative-placeholders.glitch.me/image?width=300&height=300&style="