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
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))
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))
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))
def lookup(self, lookup_uri): return self.subsonic_api.get_playlist_as_playlist( uri.get_playlist_id(lookup_uri))
def get_items(self, items_uri): return self.subsonic_api.get_playlist_as_songs_as_refs( uri.get_playlist_id(items_uri))
def delete(self, playlist_uri): playlist_id = uri.get_playlist_id(playlist_uri) self.subsonic_api.delete_playlist_raw(playlist_id)