diff --git a/couchpotato/api.py b/couchpotato/api.py index cd01197a..2ce4312c 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.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) diff --git a/couchpotato/core/media/_base/providers/torrent/torrentshack.py b/couchpotato/core/media/_base/providers/torrent/torrentshack.py index f56017f5..b65222b3 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), }) diff --git a/couchpotato/core/media/movie/_base/static/movie.actions.js b/couchpotato/core/media/movie/_base/static/movie.actions.js index de78818c..b85f1f34 100644 --- a/couchpotato/core/media/movie/_base/static/movie.actions.js +++ b/couchpotato/core/media/movie/_base/static/movie.actions.js @@ -697,7 +697,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) }