Browse Source

Final clean up

pull/4085/head
Andrew Rogl 2 months ago
parent
commit
b880e2db8a
  1. 7
      beetsplug/discogs.py
  2. 2
      test/test_discogs.py

7
beetsplug/discogs.py

@ -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

2
test/test_discogs.py

@ -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)

Loading…
Cancel
Save