From 451014f6e7674ff2f377cd13f91413d5ac45e8c3 Mon Sep 17 00:00:00 2001 From: krateng Date: Fri, 31 Mar 2023 04:22:33 +0200 Subject: [PATCH] Temporary fix for scrobbling with no album info --- maloja/database/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/maloja/database/__init__.py b/maloja/database/__init__.py index 48fb708..f40a85e 100644 --- a/maloja/database/__init__.py +++ b/maloja/database/__init__.py @@ -151,7 +151,7 @@ def rawscrobble_to_scrobbledict(rawscrobble, fix=True, client=None): # if we send [] as albumartists, it means various # if we send nothing, the scrobbler just doesnt support it and we assume track artists - if 'album_artists' not in scrobbleinfo: + if ('album_title' in scrobbleinfo) and ('album_artists' not in scrobbleinfo): scrobbleinfo['album_artists'] = scrobbleinfo.get('track_artists') # New plan, do this further down @@ -181,6 +181,9 @@ def rawscrobble_to_scrobbledict(rawscrobble, fix=True, client=None): "rawscrobble":rawscrobble } + if scrobbledict["track"]["album"]["albumtitle"] is None and scrobbledict["track"]["album"]["artists"] is None: + del scrobbledict["track"]["album"] + return scrobbledict