from .utils.leven import levenshtein_ratio
-class PlayerError(Exception):
+class PlayerError(MPDError):
"""Fatal error in the player."""
import sys
# local import
-from ..mpdclient import MPD, PlayerError, Artist, Album
+from ..mpdclient import MPD, MPDError, Artist, Album
from ..lib.simadb import SimaDB
return
try:
getattr(self, cmd.replace('-', '_'))()
- except PlayerError as err:
+ except MPDError as err:
self.log.error(err)
sys.exit(1)
for entry in ['artist', 'album', 'title']:
header = False
for bl in blocklist:
- art = bl.get(entry, '')
+ val = bl.get(entry, '')
mbid = bl.get(f'musicbrainz_{entry}', '')
- if art or mbid:
+ if val or mbid:
if not header:
header = True
self.log.info(f'{entry.capitalize()}'
'(id name musicbranzID):')
- self.log.info(f'{bl["id"]} "{art}"\t\t{mbid}')
+ self.log.info(f'{bl["id"]} "{val}"\t\t{mbid}')
def bl_add_artist(self):
artist = self.options.get('artist', None)