1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-23 01:16:18 +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`) * [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

View File

@ -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