Skip to content

Commit

Permalink
handle empty album str
Browse files Browse the repository at this point in the history
  • Loading branch information
auto authored and whatphilipcodes committed Sep 30, 2024
1 parent 25218c1 commit 320cdbe
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion beetsplug/bandcamp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,21 @@ def candidates(
if "various" in artist.lower():
artist = ""

search = {"query": album, "artist": artist, "label": label, "search_type": "a"}
if album == "":
search = {
"query": item.title,
"artist": artist,
"label": label,
"search_type": "t",
}
else:
search = {
"query": album,
"artist": artist,
"label": label,
"search_type": "a",
}

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 320cdbe

Please sign in to comment.