# makes a query internally to get the full story
_ARTIST_FIELDS = ['id', 'name', 'image']
# makes a query internally to get the full story
_ARTIST_FIELDS = ['id', 'name', 'image']
-_ALBUM_FIELDS = ['id', 'name', 'image', 'artist_name', 'artist_id']
+_ALBUM_FIELDS = ['id', 'name', 'image', 'artist_name', 'artist_id', 'license_url']
_TRACK_FIELDS = ['id', 'name', 'image', 'artist_name', 'album_name', 'album_id', 'numalbum', 'duration']
_RADIO_FIELDS = ['id', 'name', 'idstr', 'image']
_TRACK_FIELDS = ['id', 'name', 'image', 'artist_name', 'album_name', 'album_id', 'numalbum', 'duration']
_RADIO_FIELDS = ['id', 'name', 'idstr', 'image']
def _set_from(self, other):
return self._set_from_impl(other, 'name', 'image', 'albums')
def _set_from(self, other):
return self._set_from_impl(other, 'name', 'image', 'albums')
- return self._needs_load_impl('name', 'image', 'artist_name', 'artist_id', 'tracks')
+ return self._needs_load_impl('name', 'image', 'artist_name', 'artist_id', 'license_url', 'tracks')
- return self._set_from_impl(other, 'name', 'image', 'artist_name', 'artist_id', 'tracks')
+ return self._set_from_impl(other, 'name', 'image', 'artist_name', 'artist_id', 'license_url', 'tracks')
- return self._needs_load_impl('name', 'image', 'artist_name', 'album_name', 'album_id', 'numalbum', 'duration')
+ return self._needs_load_impl('name', 'artist_name', 'album_name', 'album_id', 'numalbum', 'duration')
def _set_from(self, other):
return self._set_from_impl(other, 'name', 'image', 'artist_name', 'album_name', 'album_id', 'numalbum', 'duration')
def _set_from(self, other):
return self._set_from_impl(other, 'name', 'image', 'artist_name', 'album_name', 'album_id', 'numalbum', 'duration')
self._covers[(int(m.group(1)), int(m.group(2)))] = fl
def fetch_cover(self, albumid, size):
self._covers[(int(m.group(1)), int(m.group(2)))] = fl
def fetch_cover(self, albumid, size):
coverdir = _COVERDIR if _COVERDIR else '/tmp'
to = os.path.join(coverdir, '%d-%d.jpg'%(albumid, size))
if not os.path.isfile(to):
coverdir = _COVERDIR if _COVERDIR else '/tmp'
to = os.path.join(coverdir, '%d-%d.jpg'%(albumid, size))
if not os.path.isfile(to):
def _update_cache(cache, new_items):
if not isinstance(new_items, list):
def _update_cache(cache, new_items):
if not isinstance(new_items, list):
if not a:
raise JamendoAPIException(str(q))
_update_cache(_artists, a)
if not a:
raise JamendoAPIException(str(q))
_update_cache(_artists, a)
if not a:
raise JamendoAPIException(str(q))
_update_cache(_albums, a)
if not a:
raise JamendoAPIException(str(q))
_update_cache(_albums, a)
if not a:
raise JamendoAPIException(str(q))
_update_cache(_tracks, a)
if not a:
raise JamendoAPIException(str(q))
_update_cache(_tracks, a)
- return [Radio(x['id'], json=x) for x in js]
- else:
- return Radio(radio_id, json=js)
+ ks = js[0]
+ return Radio(radio_id, json=js)