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