def __update_view_artists(self, genre_ids, artist_ids): """ Update current view with artists view @param genre ids as [int] @param artist ids as [int] """ def load(): if genre_ids and genre_ids[0] == Type.ALL: albums = Lp().albums.get_ids(artist_ids, []) else: albums = [] if artist_ids and artist_ids[0] == Type.COMPILATIONS: albums += Lp().albums.get_compilation_ids(genre_ids) albums += Lp().albums.get_ids(artist_ids, genre_ids) return albums from lollypop.view_artist import ArtistView self.__stop_current_view() view = ArtistView(artist_ids, genre_ids) loader = Loader(target=load, view=view) loader.start() view.show() self.__stack.add(view) self.__stack.set_visible_child(view) self.__stack.clean_old_views(view)
def _update_view_artists(self, artist_id, genre_id): """ Update current view with artists view @param artist id as int @param genre id as int """ def load(): sql = Lp.db.get_cursor() if artist_id == Type.COMPILATIONS: albums = Lp.albums.get_compilations(genre_id, sql) elif genre_id == Type.ALL: albums = Lp.albums.get_ids(artist_id, None, sql) else: albums = Lp.albums.get_ids(artist_id, genre_id, sql) sql.close() return albums view = ArtistView(artist_id, genre_id) loader = Loader(target=load, view=view) loader.start() view.show() self._stack.add(view) self._stack.set_visible_child(view) self._stack.clean_old_views(view)
def _update_view_artists(self, artist_ids, genre_ids): """ Update current view with artists view @param artist id as int @param genre id as int """ def load(): if artist_ids and artist_ids[0] == Type.COMPILATIONS: albums = Lp().albums.get_compilations(genre_ids) elif genre_ids and genre_ids[0] == Type.ALL: albums = Lp().albums.get_ids(artist_ids, []) else: albums = Lp().albums.get_ids(artist_ids, genre_ids) return albums view = ArtistView(artist_ids, genre_ids) loader = Loader(target=load, view=view) loader.start() view.show() self._stack.add(view) self._stack.set_visible_child(view) self._stack.clean_old_views(view)