def fill_playlist(self): songs = self.controller.model().get_playlist_songs(self.playlist_id) self.list.clear() for song in songs: artist = song.get("artist", song.get("albumArtist", "Unkown Artist")) title = song.get("title", "Unknown Title") item = QListWidgetItem("%s - %s" % (artist, title), self.list) item.song_id = song["id"]
def fill_playlist(self): songs = self.controller.model().get_queue_songs() current = self.controller.model().get_queue_current() self.list.clear() # Purge old list. for song_id, title in songs: # Higlight currently played song. if current and current[0] == song_id: title = "* %s" % title item = QListWidgetItem(title, self.list) item.song_id = song_id