1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-11-09 11:42:16 +00:00

Ugrading requests

Closes #21
This commit is contained in:
spl0k 2014-04-04 19:58:11 +02:00
parent 6f9da086f0
commit 7a060c9186
2 changed files with 6 additions and 5 deletions

View File

@ -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`)
* Python Imaging Library (`apt-get install python-imaging`)
* 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`)
### Configuration

View File

@ -89,11 +89,12 @@ class LastFm:
else:
r = requests.get('http://ws.audioscrobbler.com/2.0/', params = kwargs)
if 'error' in r.json:
if r.json['error'] in (9, '9'):
json = r.json()
if 'error' in json:
if json['error'] in (9, '9'):
self.__user.lastfm_status = False
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