Example #1
0
    def run(self):
        url = "http://api.jamendo.com/get2/id+name/album/json/?artist_id=%s" % self._artist.id
        #print('get_albums: %s' % url)
        albumresults = get_json(url)
        for albumresult in albumresults:
            item = jamtree.Album(albumresult['id'],
                                 albumresult['name'].strip())
            self._artist.add_album(item)

        self._callback(self._artist, self._add_to_playlist)
Example #2
0
    def run(self):
        url = "http://api.jamendo.com/get2/name+id/album/json/?searchquery=%s&order=%s&n=%s" % (
            self.search_term, self.order_by, self.num_results)
        results = get_json(url)
        albums = []
        for result in results:
            ar = jamtree.Album(result['id'], result['name'].strip())
            albums.append(ar)

        if albums == []:
            albums = None

        self.callback(albums)