]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/player.py
Some refactoring around player
[mpd-sima.git] / sima / lib / player.py
index c5c69f86a29f44f57eed9ee6b892a37c24a767f2..751e464ba7a3c551aabf3ff0dd2c974028fb3e82 100644 (file)
@@ -3,20 +3,32 @@
 # TODO:
 # Add decorator to filter through history?
 
-from sima.lib.track import Track
+# standard library import
+import logging
+
+# local import
+#from sima.lib.track import Track
 
 
 class Player(object):
 
     """Player interface to inherit from.
 
-    When querying palyer music library for tracks, Player instance *must* return
+    When querying player music library for tracks, Player instance *must* return
     Track objects (usually a list of them)
+
+    Player instance should expose the following immutable attributes:
+        * artists
+        * state
+        * current
+        * queue
+        * playlist
+        *
     """
 
     def __init__(self):
-        self.state = {}
-        self.current = {}
+        super().__init__()
+        self.log = logging.getLogger('sima')
 
     def monitor(self):
         """Monitor player for change
@@ -46,10 +58,31 @@ class Player(object):
     def find_album(self, artist, album):
         """
         Find tracks by track's album name
-            >>> player.find_track('Nirvana', 'Nevermind')
+            >>> player.find_album('Nirvana', 'Nevermind')
 
         Returns a list of Track objects
         """
+        raise NotImplementedError
+
+    def find_albums(self, artist):
+        """
+        Find albums by artist's name
+            >>> player.find_alums('Nirvana')
+
+        Returns a list of string objects
+        """
+        raise NotImplementedError
+
+    def fuzzy_find_artist(self, artist):
+        """
+        Find artists based on a fuzzy search in the media library
+            >>> bea = player.fuzzy_find_artist('beatles')
+            >>> print(bea)
+            >>> ['The Beatles']
+
+        Returns a list of strings (artist names)
+        """
+        raise NotImplementedError
 
     def disconnect(self):
         """Closing client connection with the Player
@@ -63,4 +96,3 @@ class Player(object):
 
 # VIM MODLINE
 # vim: ai ts=4 sw=4 sts=4 expandtab
-