def load_albums(self, list, artist): self.albumlist.albumlayout.clear_widgets() for i in MediaProvider(None).getAlbumList(artist): self.albumlist.albumlayout.add_widget( AlbumItem(album=i[0], artist=artist, cover=i[1], id=i[2])) print i
def load_album(self, id): songlist = MediaProvider(self.mediapath).get_songs_by_album_id(id) self.current_id = id if len(songlist) > 0: self.cover = songlist[0][4] self.clear_songs() App.get_running_app().root.player.mode = 'Music' App.get_running_app().root.player.playlist[:] = [] for i in range(len(songlist)): self.add_song_item(songlist[i][3], songlist[i][0], float(songlist[i][1]), songlist[i][2]) App.get_running_app().root.player.load(songlist[0][2])
def read_meta_data(self): if self.mode == 'Audiobooks': metadata = AudiobookProvider(None).get_file_info(self.currentFile) self.title = '%s (%s/%s)' % (str( metadata['title']), self.get_current_index() + 1, len(self.playlist)) self.artist = str(metadata['author']) self.cover = str(metadata['cover']) else: metadata = MediaProvider(None).getSongInfo(self.currentFile) self.title = str(metadata['title']) self.artist = str(metadata['artist']) self.album = str(metadata['album']) self.cover = str(metadata['cover']) del metadata
def prev_album(self): self.load_album( MediaProvider(None).get_next_album_id(self.current_id, -1))
def refresh(self, *args): mediapath = App.get_running_app().config.getdefault( 'General', 'media_path', 'test') MediaProvider(mediapath).scan_media() self.show_artists()
def show_artists(self): self.artistlist.artistlayout.clear_widgets() for i in MediaProvider(None).getArtistList(): self.artistlist.artistlayout.add_widget(ArtistListItem(text=i[0]))