示例#1
0
 def save(self, playlist):
     playlist_id = uri.get_playlist_id(playlist.uri)
     track_ids = []
     for trk in playlist.tracks:
         track_ids.append(uri.get_song_id(trk.uri))
     result = self.subsonic_api.save_playlist_raw(playlist_id, track_ids)
     if result is None:
         return None
     return playlist
示例#2
0
 def lookup_one(self, lookup_uri):
     type = uri.get_type(lookup_uri)
     if type == uri.ARTIST:
         return self.lookup_artist(uri.get_artist_id(lookup_uri))
     if type == uri.ALBUM:
         return self.lookup_album(uri.get_album_id(lookup_uri))
     if type == uri.DIRECTORY:
         return self.lookup_directory(uri.get_directory_id(lookup_uri))
     if type == uri.SONG:
         return self.lookup_song(uri.get_song_id(lookup_uri))
     if type == uri.PLAYLIST:
         return self.lookup_playlist(uri.get_playlist_id(lookup_uri))
示例#3
0
 def lookup(self, lookup_uri):
     #logger.info('LOOKUP PLAYLIST %s: %s' % (lookup_uri, self.subsonic_api.get_playlist_as_playlist(uri.get_playlist_id(lookup_uri))))
     return self.subsonic_api.get_playlist_as_playlist(uri.get_playlist_id(lookup_uri))
示例#4
0
 def get_items(self, items_uri):
     #logger.info('ITEMS %s: %s' % (lookup_uri, self.subsonic_api.get_playlist_songs_as_refs(uri.get_playlist_id(items_uri))))
     return self.subsonic_api.get_playlist_as_songs_as_refs(uri.get_playlist_id(items_uri))
示例#5
0
 def lookup(self, lookup_uri):
     return self.subsonic_api.get_playlist_as_playlist(
         uri.get_playlist_id(lookup_uri))
示例#6
0
 def get_items(self, items_uri):
     return self.subsonic_api.get_playlist_as_songs_as_refs(
         uri.get_playlist_id(items_uri))
示例#7
0
 def delete(self, playlist_uri):
     playlist_id = uri.get_playlist_id(playlist_uri)
     self.subsonic_api.delete_playlist_raw(playlist_id)