]> kaliko git repositories - mpd-sima.git/commitdiff
PlayerError inherit from MPDError instead of plain Exception
authorkaliko <kaliko@azylum.org>
Tue, 8 Jun 2021 14:30:01 +0000 (16:30 +0200)
committerkaliko <kaliko@azylum.org>
Tue, 8 Jun 2021 14:30:01 +0000 (16:30 +0200)
sima/mpdclient.py
sima/utils/blcli.py

index 539f8b83b62b37ac2f8e15f45a6528d585db903d..1d86813b20538938d78c0db76d2070fe7736e8e4 100644 (file)
@@ -32,7 +32,7 @@ from .lib.simastr import SimaStr
 from .utils.leven import levenshtein_ratio
 
 
-class PlayerError(Exception):
+class PlayerError(MPDError):
     """Fatal error in the player."""
 
 
index 5f0d14a9c1bae797d6f9f68e1b347c9f3dc08678..63d3bf41113dd150158c1727971c32b826c13f04 100644 (file)
@@ -21,7 +21,7 @@ import atexit
 import sys
 
 # local import
-from ..mpdclient import MPD, PlayerError, Artist, Album
+from ..mpdclient import MPD, MPDError, Artist, Album
 from ..lib.simadb import SimaDB
 
 
@@ -37,7 +37,7 @@ class BLCli(MPD):
             return
         try:
             getattr(self, cmd.replace('-', '_'))()
-        except PlayerError as err:
+        except MPDError as err:
             self.log.error(err)
             sys.exit(1)
 
@@ -46,14 +46,14 @@ class BLCli(MPD):
         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)