]> kaliko git repositories - mpd-sima.git/commitdiff
More robust MPD client
authorkaliko <kaliko@azylum.org>
Tue, 3 Feb 2015 17:42:31 +0000 (18:42 +0100)
committerkaliko <kaliko@azylum.org>
Tue, 3 Feb 2015 17:42:31 +0000 (18:42 +0100)
doc/Changelog
sima/client.py

index 1582b892172760d4897f2f83e02777afe74cfc27..f9466e1c068d101ffb3789e6d21c26927b3e58be 100644 (file)
@@ -3,6 +3,7 @@ MPD_sima v0.14.0
  * Fixed top track mode
  * Fixed default conf file name (back to mpd_sima.cfg)
  * Cleanup code (removed users similarities)
+ * More robust MPD client
 
 -- kaliko jack <kaliko@azylum.org> UNRELEASED
 
index 63c2632c85910bb8582df793953b204e69361146..f64277e8f1bd21b2325d62a654dbe74362a73d08 100644 (file)
@@ -162,9 +162,9 @@ class PlayerClient(Player):
                 'artists': None,
                 'nombid_artists': None,
                 }
-        self._cache['artists'] = frozenset(self._client.list('artist'))
+        self._cache['artists'] = frozenset(self._execute('list', ['artist']))
         if Artist.use_mbid:
-            self._cache['nombid_artists'] = frozenset(self._client.list('artist', 'musicbrainz_artistid', ''))
+            self._cache['nombid_artists'] = frozenset(self._execute('list', ['artist', 'musicbrainz_artistid', '']))
 
     @blacklist(track=True)
     def find_track(self, artist, title=None):
@@ -196,7 +196,7 @@ class PlayerClient(Player):
         found = False
         if artist.mbid:
             # look for exact search w/ musicbrainz_artistid
-            exact_m = self._client.list('artist', 'musicbrainz_artistid', artist.mbid)
+            exact_m = self._execute('list', ['artist', 'musicbrainz_artistid', artist.mbid])
             if exact_m:
                 [artist.add_alias(name) for name in exact_m]
                 found = True
@@ -332,7 +332,7 @@ class PlayerClient(Player):
     def add(self, track):
         """Overriding MPD's add method to accept add signature with a Track
         object"""
-        self._client.add(track.file)
+        self._execute('add', [track.file])
 
     @property
     def artists(self):