Esempio n. 1
0
        def _append_songs(songs_args, error=None):
            songs, self.songs_total = songs_args
            if not songs or self.songs_total == 0 or self.use_album:
                songs = Net.get_album(self.curr_list_id)
                self.songs_total = 1
                if not songs:
                    return
                for song in songs:
                    self.liststore_songs.append([
                        True,
                        Widgets.unescape(song['name']),
                        Widgets.unescape(song['artist']),
                        Widgets.unescape(self.curr_list_name),
                        int(song['id']),
                        int(song['artistid']),
                        int(self.curr_list_id),
                    ])
                return

            for song in songs:
                self.liststore_songs.append([
                    True,
                    Widgets.unescape(song['name']),
                    Widgets.unescape(song['artist']),
                    Widgets.unescape(song['album']),
                    int(song['id']),
                    int(song['artistid']),
                    int(song['albumid']),
                ])
            self.songs_page += 1
            if self.songs_page < self.songs_total - 1:
                self.append_songs()
Esempio n. 2
0
        def _append_songs(songs_args, error=None):
            songs, self.songs_total = songs_args
            if len(songs) == 0 or self.songs_total == 0 or self.use_album:
                songs = Net.get_album(self.curr_list_id)
                self.songs_total = 1
                if songs is None:
                    return
                for song in songs:
                    self.liststore_songs.append([True,
                        song['name'], 
                        song['artist'],
                        self.curr_list_name, 
                        int(song['id']),
                        int(song['artistid']), 
                        int(self.curr_list_id), ])
                return

            for song in songs:
                self.liststore_songs.append([True,
                    song['name'],
                    song['artist'],
                    song['album'],
                    int(song['id']),
                    int(song['artistid']), 
                    int(song['albumid']), ])
            self.songs_page += 1
            if self.songs_page < self.songs_total - 1:
                self.append_songs()