Skip to content

Commit

Permalink
add: fb missing artist (#72)
Browse files Browse the repository at this point in the history
Just found that my alterations to the search (#68) break if the artist
is empty (bandcamp search can't handle ' - title' syntax in search).
This fixes the issue. I did not include a changelog entry as this
feature has not been released yet and is already present in the log.
  • Loading branch information
whatphilipcodes authored Oct 29, 2024
1 parent bec5570 commit 5f90747
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions beetsplug/bandcamp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,20 +216,19 @@ def candidates(
if "various" in artist.lower():
artist = ""

if album == "":
search = {
"query": artist + " - " + item.title,
"artist": artist,
"label": label,
"search_type": "",
}
if album:
query = album
search_type = "a"
else:
search = {
"query": album,
"artist": artist,
"label": label,
"search_type": "a",
}
query = " - ".join(filter(None, [artist, item.title]))
search_type = ""

search = {
"query": query,
"artist": artist,
"label": label,
"search_type": search_type,
}

results = map(itemgetter("url"), self._search(search))
yield from chain.from_iterable(filter(None, map(self.get_album_info, results)))
Expand Down

0 comments on commit 5f90747

Please sign in to comment.