mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-23 01:16:18 +00:00
parent
6f9da086f0
commit
7a060c9186
@ -27,7 +27,7 @@ or as a WSGI application (on Apache for instance). But first:
|
|||||||
* [SQLAlchemy](http://www.sqlalchemy.org/) (`apt-get install python-sqlalchemy`)
|
* [SQLAlchemy](http://www.sqlalchemy.org/) (`apt-get install python-sqlalchemy`)
|
||||||
* Python Imaging Library (`apt-get install python-imaging`)
|
* Python Imaging Library (`apt-get install python-imaging`)
|
||||||
* simplejson (`apt-get install python-simplejson`)
|
* simplejson (`apt-get install python-simplejson`)
|
||||||
* [requests](http://docs.python-requests.org/) >= 0.12.1 (`pip install requests`)
|
* [requests](http://docs.python-requests.org/) >= 1.0.0 (`pip install requests`)
|
||||||
* [mutagen](https://code.google.com/p/mutagen/) (`apt-get install python-mutagen`)
|
* [mutagen](https://code.google.com/p/mutagen/) (`apt-get install python-mutagen`)
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
@ -89,11 +89,12 @@ class LastFm:
|
|||||||
else:
|
else:
|
||||||
r = requests.get('http://ws.audioscrobbler.com/2.0/', params = kwargs)
|
r = requests.get('http://ws.audioscrobbler.com/2.0/', params = kwargs)
|
||||||
|
|
||||||
if 'error' in r.json:
|
json = r.json()
|
||||||
if r.json['error'] in (9, '9'):
|
if 'error' in json:
|
||||||
|
if json['error'] in (9, '9'):
|
||||||
self.__user.lastfm_status = False
|
self.__user.lastfm_status = False
|
||||||
session.commit()
|
session.commit()
|
||||||
self.__logger.warn('LastFM error %i: %s' % (r.json['error'], r.json['message']))
|
self.__logger.warn('LastFM error %i: %s' % (json['error'], json['message']))
|
||||||
|
|
||||||
return r.json
|
return json
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user