diff --git a/beetsplug/bandcamp/__init__.py b/beetsplug/bandcamp/__init__.py index 17a3bc9..35c693f 100644 --- a/beetsplug/bandcamp/__init__.py +++ b/beetsplug/bandcamp/__init__.py @@ -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)))