mirror of
https://github.com/beetbox/beets.git
synced 2025-12-27 02:52:33 +01:00
Guard against None match
This commit is contained in:
parent
867242da65
commit
112941b944
1 changed files with 5 additions and 2 deletions
|
|
@ -302,8 +302,11 @@ class APIAutotaggerPlugin(object):
|
|||
u"Searching {} for {} '{}'", self.data_source, url_type, id_
|
||||
)
|
||||
match = re.search(self.id_regex['pattern'].format(url_type), str(id_))
|
||||
id_ = match.group(self.id_regex['match_group'])
|
||||
return id_ if id_ else None
|
||||
if match:
|
||||
id_ = match.group(self.id_regex['match_group'])
|
||||
if id_:
|
||||
return id_
|
||||
return None
|
||||
|
||||
def candidates(self, items, artist, album, va_likely):
|
||||
"""Returns a list of AlbumInfo objects for Search API results
|
||||
|
|
|
|||
Loading…
Reference in a new issue