Beispiel #1
0
 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
Beispiel #2
0
 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
Beispiel #3
0
 def isFavoritePlaylist(self, playlist_id):
     self.load_all()
     return Favorites.isFavoritePlaylist(self, playlist_id)
Beispiel #4
0
 def isFavoriteAlbum(self, album_id):
     self.load_all()
     return Favorites.isFavoriteAlbum(self, album_id)
Beispiel #5
0
 def isFavoriteArtist(self, artist_id):
     self.load_all()
     return Favorites.isFavoriteArtist(self, artist_id)
Beispiel #6
0
 def remove(self, content_type, item_id):
     ok = Favorites.remove(self, content_type, item_id)
     if ok:
         self.get(content_type)
     return ok
Beispiel #7
0
 def add(self, content_type, item_ids):
     ok = Favorites.add(self, content_type, item_ids)
     if ok:
         self.get(content_type)
     return ok
Beispiel #8
0
 def __init__(self, session, user_id):
     Favorites.__init__(self, session, user_id)
Beispiel #9
0
 def isFavoriteVideo(self, video_id):
     self.load_all()
     return Favorites.isFavoriteVideo(self, video_id)
Beispiel #10
0
 def isFavoriteTrack(self, track_id):
     self.load_all()
     return Favorites.isFavoriteTrack(self, track_id)