Merge pull request #178 from JackDandy/feature/ChangeuTCompat

Feature/change uT compat
This commit is contained in:
JackDandy 2015-02-12 16:38:40 +00:00
commit 1abd4e6013
2 changed files with 6 additions and 2 deletions

View file

@ -35,6 +35,7 @@
* Add "On Air until" text and overdue/on air colour bars to show episode states on the Episodes page/DayByDay layout
* Change The Pirate Bay url back as it's now back up and oldpiratebay hasn't been updated for weeks
* Remove duplicate thepiratebay icon
* Change to ensure uTorrent API parameters are ordered for uT 2.2.1 compatibility
[develop changelog]

View file

@ -21,6 +21,7 @@ import re
import sickbeard
from sickbeard import logger
from sickbeard.clients.generic import GenericClient
import urllib
class uTorrentAPI(GenericClient):
@ -32,8 +33,10 @@ class uTorrentAPI(GenericClient):
def _request(self, method='get', params={}, files=None):
params.update({'token': self.auth})
return super(uTorrentAPI, self)._request(method=method, params=params, files=files)
return super(uTorrentAPI, self)._request(
method=method,
params='token=%s&%s' % (self.auth, '&'.join([u'%s' % urllib.urlencode(dict([[key, str(value)]])) for key, value in params.iteritems()])) if any(params) else params,
files=files)
def _get_auth(self):