From f977dda22492108e71af38999d90fe71699a3b5e Mon Sep 17 00:00:00 2001 From: Robert Kaye Date: Sat, 30 Dec 2023 22:42:09 +0100 Subject: [PATCH] artist, tag and stats elements now play cleanly together! --- lb_content_resolver/content_resolver.py | 8 ++++---- lb_content_resolver/lb_radio.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lb_content_resolver/content_resolver.py b/lb_content_resolver/content_resolver.py index 03733ac..cf23e46 100755 --- a/lb_content_resolver/content_resolver.py +++ b/lb_content_resolver/content_resolver.py @@ -116,19 +116,19 @@ def resolve_playlist(self, match_threshold, recordings=None, jspf_playlist=None) .dicts() rec_index = {r["id"]: r for r in recordings} - print(" %-40s %-40s %-40s" % ("ARTIST", "RECORDING", "RELEASE")) + print(" %-40s %-40s %-40s" % ("RECORDING", "RELEASE", "ARTIST")) results = [None] * len(artist_recording_data) for i, artist_recording in enumerate(artist_recording_data): if i not in hit_index: - print(bcolors.FAIL + "FAIL" + bcolors.ENDC + " %-40s %-40s" % (artist_recording["recording_name"][:39], + print(bcolors.FAIL + "FAIL" + bcolors.ENDC + " %-40s %-40s %-40s" % (artist_recording["recording_name"][:39], "", artist_recording["artist_name"][:39])) continue hit = hit_index[i] rec = rec_index[hit["recording_id"]] results[hit["index"]] = rec - print(bcolors.OKGREEN + "OK" + bcolors.ENDC + " %-40s %-40s" % (artist_recording["artist_name"][:39], - artist_recording["recording_name"][:39])) + print(bcolors.OKGREEN + "OK" + bcolors.ENDC + " %-40s %-40s %-40s" % (artist_recording["recording_name"][:39], "", + artist_recording["artist_name"][:39])) print(" %-40s %-40s %-40s" % (rec["recording_name"][:39], rec["release_name"][:39], rec["artist_name"][:39])) diff --git a/lb_content_resolver/lb_radio.py b/lb_content_resolver/lb_radio.py index 130c8c3..ca897d1 100755 --- a/lb_content_resolver/lb_radio.py +++ b/lb_content_resolver/lb_radio.py @@ -86,7 +86,7 @@ def resolve_recordings(self, playlist): cr = ContentResolver(self.db) resolved = cr.resolve_playlist(self.MATCH_THRESHOLD, recordings) - for i, t_recording in enumerate(playlist.playlists[0].recordings): + for i, t_recording in enumerate(recordings): if resolved[i] is not None: if resolved[i]["subsonic_id"] != "": t_recording.musicbrainz["subsonic_id"] = resolved[i]["subsonic_id"]