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 _get_view_artists(self, genre_ids, artist_ids): """ Get artists view for genres/artists @param genre_ids as [int] @param artist_ids as [int] """ def load(): if genre_ids and genre_ids[0] == Type.ALL: if App().settings.get_value("show-performers"): items = App().tracks.get_album_ids(artist_ids, []) else: items = App().albums.get_ids(artist_ids, []) else: if App().settings.get_value("show-performers"): items = App().tracks.get_album_ids(artist_ids, genre_ids) else: items = App().albums.get_ids(artist_ids, genre_ids) return [ Album(album_id, genre_ids, artist_ids) for album_id in items ] if App().window.is_adaptive: from lollypop.view_artist_small import ArtistViewSmall view = ArtistViewSmall(artist_ids, genre_ids) else: from lollypop.view_artist import ArtistView view = ArtistView(artist_ids, genre_ids) loader = Loader(target=load, view=view) loader.start() view.show() return view
def _get_view_artists(self, genre_ids, artist_ids): """ Get artists view for genres/artists @param genre ids as [int] @param artist ids as [int] """ def load(): if genre_ids and genre_ids[0] == Type.ALL: items = App().albums.get_ids(artist_ids, []) else: items = [] if artist_ids and artist_ids[0] == Type.COMPILATIONS: items += App().albums.get_compilation_ids(genre_ids) items += App().albums.get_ids(artist_ids, genre_ids) return [ Album(album_id, genre_ids, artist_ids) for album_id in items ] if App().window.is_adaptive: from lollypop.view_albums_list import AlbumsListView view = AlbumsListView(RowListType.DEFAULT, artist_ids, genre_ids) else: from lollypop.view_artist import ArtistView view = ArtistView(artist_ids, genre_ids) loader = Loader(target=load, view=view) loader.start() view.show() return 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)