Landscape.io fixes
This commit is contained in:
parent
0ae79be3a0
commit
0a158e7238
44
pylast.py
44
pylast.py
|
@ -312,9 +312,9 @@ class _Network(object):
|
||||||
if domain_language in self.domain_names:
|
if domain_language in self.domain_names:
|
||||||
return self.domain_names[domain_language]
|
return self.domain_names[domain_language]
|
||||||
|
|
||||||
def _get_url(self, domain, type):
|
def _get_url(self, domain, url_type):
|
||||||
return "http://%s/%s" % (
|
return "http://%s/%s" % (
|
||||||
self._get_language_domain(domain), self.urls[type])
|
self._get_language_domain(domain), self.urls[url_type])
|
||||||
|
|
||||||
def _get_ws_auth(self):
|
def _get_ws_auth(self):
|
||||||
"""
|
"""
|
||||||
|
@ -404,14 +404,14 @@ class _Network(object):
|
||||||
return seq
|
return seq
|
||||||
|
|
||||||
def get_geo_events(
|
def get_geo_events(
|
||||||
self, long=None, lat=None, location=None, distance=None,
|
self, longitude=None, latitude=None, location=None, distance=None,
|
||||||
tag=None, festivalsonly=None, limit=None, cacheable=True):
|
tag=None, festivalsonly=None, limit=None, cacheable=True):
|
||||||
"""
|
"""
|
||||||
Returns all events in a specific location by country or city name.
|
Returns all events in a specific location by country or city name.
|
||||||
Parameters:
|
Parameters:
|
||||||
long (Optional) : Specifies a longitude value to retrieve events for
|
longitude (Optional) : Specifies a longitude value to retrieve events
|
||||||
(service returns nearby events by default)
|
for (service returns nearby events by default)
|
||||||
lat (Optional) : Specifies a latitude value to retrieve events for
|
latitude (Optional) : Specifies a latitude value to retrieve events for
|
||||||
(service returns nearby events by default)
|
(service returns nearby events by default)
|
||||||
location (Optional) : Specifies a location to retrieve events for
|
location (Optional) : Specifies a location to retrieve events for
|
||||||
(service returns nearby events by default)
|
(service returns nearby events by default)
|
||||||
|
@ -426,10 +426,10 @@ class _Network(object):
|
||||||
|
|
||||||
params = {}
|
params = {}
|
||||||
|
|
||||||
if long:
|
if longitude:
|
||||||
params["long"] = long
|
params["long"] = longlongitude
|
||||||
if lat:
|
if latitude:
|
||||||
params["lat"] = lat
|
params["lat"] = latitude
|
||||||
if location:
|
if location:
|
||||||
params["location"] = location
|
params["location"] = location
|
||||||
if limit:
|
if limit:
|
||||||
|
@ -768,17 +768,17 @@ class _Network(object):
|
||||||
if remaining_tracks:
|
if remaining_tracks:
|
||||||
self.scrobble_many(remaining_tracks)
|
self.scrobble_many(remaining_tracks)
|
||||||
|
|
||||||
def get_play_links(self, type, things, cacheable=True):
|
def get_play_links(self, link_type, things, cacheable=True):
|
||||||
method = type + ".getPlaylinks"
|
method = type + ".getPlaylinks"
|
||||||
params = {}
|
params = {}
|
||||||
|
|
||||||
for i, thing in enumerate(things):
|
for i, thing in enumerate(things):
|
||||||
if type == "artist":
|
if link_type == "artist":
|
||||||
params['artist[' + str(i) + ']'] = thing
|
params['artist[' + str(i) + ']'] = thing
|
||||||
elif type == "album":
|
elif link_type == "album":
|
||||||
params['artist[' + str(i) + ']'] = thing.artist
|
params['artist[' + str(i) + ']'] = thing.artist
|
||||||
params['album[' + str(i) + ']'] = thing.title
|
params['album[' + str(i) + ']'] = thing.title
|
||||||
elif type == "track":
|
elif link_type == "track":
|
||||||
params['artist[' + str(i) + ']'] = thing.artist
|
params['artist[' + str(i) + ']'] = thing.artist
|
||||||
params['track[' + str(i) + ']'] = thing.title
|
params['track[' + str(i) + ']'] = thing.title
|
||||||
|
|
||||||
|
@ -793,13 +793,13 @@ class _Network(object):
|
||||||
return seq
|
return seq
|
||||||
|
|
||||||
def get_artist_play_links(self, artists, cacheable=True):
|
def get_artist_play_links(self, artists, cacheable=True):
|
||||||
return self.get_play_links("artist", artists)
|
return self.get_play_links("artist", artists, cacheable)
|
||||||
|
|
||||||
def get_album_play_links(self, albums, cacheable=True):
|
def get_album_play_links(self, albums, cacheable=True):
|
||||||
return self.get_play_links("album", albums)
|
return self.get_play_links("album", albums, cacheable)
|
||||||
|
|
||||||
def get_track_play_links(self, tracks, cacheable=True):
|
def get_track_play_links(self, tracks, cacheable=True):
|
||||||
return self.get_play_links("track", tracks)
|
return self.get_play_links("track", tracks, cacheable)
|
||||||
|
|
||||||
|
|
||||||
class LastFMNetwork(_Network):
|
class LastFMNetwork(_Network):
|
||||||
|
@ -2089,6 +2089,8 @@ class Artist(_BaseObject, _Taggable):
|
||||||
"""
|
"""
|
||||||
The artist.getImages method has been deprecated by Last.fm.
|
The artist.getImages method has been deprecated by Last.fm.
|
||||||
"""
|
"""
|
||||||
|
assert order # silence warnings
|
||||||
|
assert limit # silence warnings
|
||||||
raise WSError(
|
raise WSError(
|
||||||
self.network, "27",
|
self.network, "27",
|
||||||
"The artist.getImages method has been deprecated by Last.fm.")
|
"The artist.getImages method has been deprecated by Last.fm.")
|
||||||
|
@ -2717,7 +2719,7 @@ class Playlist(_BaseObject):
|
||||||
|
|
||||||
__hash__ = _BaseObject.__hash__
|
__hash__ = _BaseObject.__hash__
|
||||||
|
|
||||||
def __init__(self, user, id, network):
|
def __init__(self, user, playlist_id, network):
|
||||||
_BaseObject.__init__(self, network, "playlist")
|
_BaseObject.__init__(self, network, "playlist")
|
||||||
|
|
||||||
if isinstance(user, User):
|
if isinstance(user, User):
|
||||||
|
@ -2725,7 +2727,7 @@ class Playlist(_BaseObject):
|
||||||
else:
|
else:
|
||||||
self.user = User(user, self.network)
|
self.user = User(user, self.network)
|
||||||
|
|
||||||
self.id = id
|
self.id = playlist_id
|
||||||
|
|
||||||
@_string_output
|
@_string_output
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
@ -3897,10 +3899,10 @@ class Venue(_BaseObject):
|
||||||
|
|
||||||
__hash__ = _BaseObject.__hash__
|
__hash__ = _BaseObject.__hash__
|
||||||
|
|
||||||
def __init__(self, id, network, venue_element=None):
|
def __init__(self, netword_id, network, venue_element=None):
|
||||||
_BaseObject.__init__(self, network, "venue")
|
_BaseObject.__init__(self, network, "venue")
|
||||||
|
|
||||||
self.id = _number(id)
|
self.id = _number(netword_id)
|
||||||
if venue_element is not None:
|
if venue_element is not None:
|
||||||
self.info = _extract_element_tree(venue_element)
|
self.info = _extract_element_tree(venue_element)
|
||||||
self.name = self.info.get('name')
|
self.name = self.info.get('name')
|
||||||
|
|
Loading…
Reference in a new issue