Final clean up

This commit is contained in:
Andrew Rogl 2021-10-05 13:00:38 +10:00
parent 109f4fa430
commit b880e2db8a
2 changed files with 4 additions and 5 deletions

View file

@ -218,10 +218,9 @@ class DiscogsPlugin(BeetsPlugin):
]:
match = re.search(pattern, album_id)
if match:
break
if not match:
return None
return int(match.group('id'))
return int(match.group('id'))
return None
def album_for_id(self, album_id):
"""Fetches an album by its Discogs ID and returns an AlbumInfo object

View file

@ -368,7 +368,7 @@ class DGAlbumInfoTest(_common.TestCase):
('005b84a0-ecd6-39f1-b2f6-6eb48756b268', ''),
]
for test_pattern, expected in test_patterns:
match = DiscogsPlugin().extract_release_id_regex(test_pattern)
match = DiscogsPlugin.extract_release_id_regex(test_pattern)
if not match:
match = ''
self.assertEqual(match, expected)