Skip to content

Commit

Permalink
Artist nosim fix (#149)
Browse files Browse the repository at this point in the history
* If nosim is specified, request 0 similar artists. This change
depends on metabrainz/listenbrainz-server#2970
to be deployed.

* Remove print
  • Loading branch information
mayhem authored Aug 30, 2024
1 parent 52171f2 commit a74f711
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion troi/patches/lb_radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def create(self, inputs):
for element in prompt_elements:
if element["entity"] == "artist":
name, mbid = self.lookup_artist(element["values"][0])
print(name, mbid)
element["values"][0] = mbid
artist_names[mbid] = name

Expand Down
7 changes: 6 additions & 1 deletion troi/patches/lb_radio_classes/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ def read(self, entities):
# Fetch our mode ranges
start, stop = self.local_storage["modes"][self.mode]
self.recording_search_by_artist = self.patch.get_service("recording-search-by-artist")
if self.include_similar_artists:
similar_artist_count = self.MAX_NUM_SIMILAR_ARTISTS
else:
similar_artist_count = 0

(artist_recordings, msgs) = self.recording_search_by_artist.search(self.mode, self.artist_mbid, start, stop,
self.max_top_recordings_per_artist,
self.MAX_NUM_SIMILAR_ARTISTS)
similar_artist_count)
# Collect the names of the similar artists
similar_artist_names = []
for mbid in artist_recordings:
Expand Down

0 comments on commit a74f711

Please sign in to comment.