From cb8d24ef1f7f17c3a7fffcfeed5ce0398c6eab1b Mon Sep 17 00:00:00 2001 From: mano3m Date: Mon, 15 Dec 2014 21:55:44 +0100 Subject: [PATCH 1/4] Fix TorrentShack size --- couchpotato/core/media/_base/providers/torrent/torrentshack.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/media/_base/providers/torrent/torrentshack.py b/couchpotato/core/media/_base/providers/torrent/torrentshack.py index f56017f..b65222b 100644 --- a/couchpotato/core/media/_base/providers/torrent/torrentshack.py +++ b/couchpotato/core/media/_base/providers/torrent/torrentshack.py @@ -42,6 +42,7 @@ class Base(TorrentProvider): link = result.find('span', attrs = {'class': 'torrent_name_link'}).parent url = result.find('td', attrs = {'class': 'torrent_td'}).find('a') + size = result.find('td', attrs = {'class': 'size'}).contents[0].strip('\n ') tds = result.find_all('td') results.append({ @@ -49,7 +50,7 @@ class Base(TorrentProvider): 'name': six.text_type(link.span.string).translate({ord(six.u('\xad')): None}), 'url': self.urls['download'] % url['href'], 'detail_url': self.urls['download'] % link['href'], - 'size': self.parseSize(result.find_all('td')[5].string), + 'size': self.parseSize(size), 'seeders': tryInt(tds[len(tds)-2].string), 'leechers': tryInt(tds[len(tds)-1].string), }) From ddf575a86e40092fb5443bebcdfd02b85e97b486 Mon Sep 17 00:00:00 2001 From: Rami Taibah Date: Wed, 17 Dec 2014 13:00:54 +0300 Subject: [PATCH 2/4] Change Readd in tooltip to Re-add. Former is confusing and not an English word --- couchpotato/core/media/movie/_base/static/movie.actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/couchpotato/core/media/movie/_base/static/movie.actions.js b/couchpotato/core/media/movie/_base/static/movie.actions.js index 09a998f..273df5a 100644 --- a/couchpotato/core/media/movie/_base/static/movie.actions.js +++ b/couchpotato/core/media/movie/_base/static/movie.actions.js @@ -696,7 +696,7 @@ MA.Readd = new Class({ if(movie_done || snatched && snatched > 0) self.el = new Element('a.readd', { - 'title': 'Readd the movie and mark all previous snatched/downloaded as ignored', + 'title': 'Re-add the movie and mark all previous snatched/downloaded as ignored', 'events': { 'click': self.doReadd.bind(self) } From 576bcb9f4b389d271da6a88addb50405c8f21dff Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 19 Dec 2014 08:57:24 +0100 Subject: [PATCH 3/4] Give response back to the main thread on api calls fix #4337 --- couchpotato/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/couchpotato/api.py b/couchpotato/api.py index cd01197..3602513 100644 --- a/couchpotato/api.py +++ b/couchpotato/api.py @@ -7,6 +7,7 @@ import urllib from couchpotato.core.helpers.request import getParams from couchpotato.core.logger import CPLog +from tornado.ioloop import IOLoop from tornado.web import RequestHandler, asynchronous @@ -33,7 +34,7 @@ def run_async(func): def run_handler(route, kwargs, callback = None): try: res = api[route](**kwargs) - callback(res, route) + IOLoop.instance().add_callback(callback, res, route) except: log.error('Failed doing api request "%s": %s', (route, traceback.format_exc())) callback({'success': False, 'error': 'Failed returning results'}, route) From eea9f40501573c8554f0abc089bb0c8431fab7a3 Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 19 Dec 2014 09:01:52 +0100 Subject: [PATCH 4/4] Use current --- couchpotato/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/couchpotato/api.py b/couchpotato/api.py index 3602513..2ce4312 100644 --- a/couchpotato/api.py +++ b/couchpotato/api.py @@ -34,7 +34,7 @@ def run_async(func): def run_handler(route, kwargs, callback = None): try: res = api[route](**kwargs) - IOLoop.instance().add_callback(callback, res, route) + IOLoop.current().add_callback(callback, res, route) except: log.error('Failed doing api request "%s": %s', (route, traceback.format_exc())) callback({'success': False, 'error': 'Failed returning results'}, route)