Updated the soap method GetPlaylist, the name of PlayList return variable.
[zukebox] / zukebox_server / src / services / playlist / zb_playlist.py
index fd4b067..d4daa3a 100644 (file)
@@ -26,14 +26,17 @@ class PlayList(Service):
     srvc_type = "urn:schemas-upnp-org:service:PlayList:1"
     srvc_name = "PlayList"
 
-    def __init__(self, positions=10, xml_path=''):
+    #list = [{'CurrentURI':'teste', 'CurrenteURIMetaData':'teste', 'FromName':'teste', 'ToName':'teste'},
+    #        {'CurrentURI':'teste', 'CurrenteURIMetaData':'teste', 'FromName':'teste', 'ToName':'teste'}]
+
+    def __init__(self, positions, xml_path):
         scpd_path = pjoin(xml_path, "zukebox-playlist-scpd.xml")
         log.info("PlayList service scpd_path = %s" % scpd_path)
         Service.__init__(self, self.srvc_name, self.srvc_type, '', scpd_path)
 
         self.positions = positions
         self.list = []
-        self.current = 0
+        self.current = None
         self.prev = self.current
         self.next = None
         self.from_name = None
@@ -116,6 +119,11 @@ class PlayList(Service):
         prev_uri = prev["cur_uri"]
         return {"PreviousItem": prev_uri}
 
+    def soap_GetPlayList(self, *args, **kwargs):
+        """Get the playlist"""
+        playlist = str(self.get_playlist())
+        return {"PlayList": playlist}
+
 
     def clean_playlist(self):
         if self.available: