Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
artist, tag and stats elements now play cleanly together!
Browse files Browse the repository at this point in the history
  • Loading branch information
mayhem committed Dec 30, 2023
1 parent e425bae commit f977dda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lb_content_resolver/content_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down
2 changes: 1 addition & 1 deletion lb_content_resolver/lb_radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit f977dda

Please sign in to comment.