def load_all(self, force_reload=False): if not force_reload and self.ids_loaded: return self.ids if not force_reload: self.load_cache() if force_reload or not self.ids_loaded: Favorites.load_all(self, force_reload=force_reload) self.save_cache() return self.ids
def get(self, content_type, limit=9999): items = Favorites.get(self, content_type, limit=limit) if items: self.load_all() self.ids[content_type] = ['%s' % item.id for item in items] self.save_cache() return items
def isFavoritePlaylist(self, playlist_id): self.load_all() return Favorites.isFavoritePlaylist(self, playlist_id)
def isFavoriteAlbum(self, album_id): self.load_all() return Favorites.isFavoriteAlbum(self, album_id)
def isFavoriteArtist(self, artist_id): self.load_all() return Favorites.isFavoriteArtist(self, artist_id)
def remove(self, content_type, item_id): ok = Favorites.remove(self, content_type, item_id) if ok: self.get(content_type) return ok
def add(self, content_type, item_ids): ok = Favorites.add(self, content_type, item_ids) if ok: self.get(content_type) return ok
def __init__(self, session, user_id): Favorites.__init__(self, session, user_id)
def isFavoriteVideo(self, video_id): self.load_all() return Favorites.isFavoriteVideo(self, video_id)
def isFavoriteTrack(self, track_id): self.load_all() return Favorites.isFavoriteTrack(self, track_id)