Browse Source

Merge branch 'develop' into redesign

pull/5180/head
Ruud 11 years ago
parent
commit
9883a7a85a
  1. 3
      couchpotato/api.py
  2. 3
      couchpotato/core/media/_base/providers/torrent/torrentshack.py
  3. 2
      couchpotato/core/media/movie/_base/static/movie.actions.js

3
couchpotato/api.py

@ -7,6 +7,7 @@ import urllib
from couchpotato.core.helpers.request import getParams from couchpotato.core.helpers.request import getParams
from couchpotato.core.logger import CPLog from couchpotato.core.logger import CPLog
from tornado.ioloop import IOLoop
from tornado.web import RequestHandler, asynchronous from tornado.web import RequestHandler, asynchronous
@ -33,7 +34,7 @@ def run_async(func):
def run_handler(route, kwargs, callback = None): def run_handler(route, kwargs, callback = None):
try: try:
res = api[route](**kwargs) res = api[route](**kwargs)
callback(res, route) IOLoop.current().add_callback(callback, res, route)
except: except:
log.error('Failed doing api request "%s": %s', (route, traceback.format_exc())) log.error('Failed doing api request "%s": %s', (route, traceback.format_exc()))
callback({'success': False, 'error': 'Failed returning results'}, route) callback({'success': False, 'error': 'Failed returning results'}, route)

3
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 link = result.find('span', attrs = {'class': 'torrent_name_link'}).parent
url = result.find('td', attrs = {'class': 'torrent_td'}).find('a') 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') tds = result.find_all('td')
results.append({ results.append({
@ -49,7 +50,7 @@ class Base(TorrentProvider):
'name': six.text_type(link.span.string).translate({ord(six.u('\xad')): None}), 'name': six.text_type(link.span.string).translate({ord(six.u('\xad')): None}),
'url': self.urls['download'] % url['href'], 'url': self.urls['download'] % url['href'],
'detail_url': self.urls['download'] % link['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), 'seeders': tryInt(tds[len(tds)-2].string),
'leechers': tryInt(tds[len(tds)-1].string), 'leechers': tryInt(tds[len(tds)-1].string),
}) })

2
couchpotato/core/media/movie/_base/static/movie.actions.js

@ -697,7 +697,7 @@ MA.Readd = new Class({
if(movie_done || snatched && snatched > 0) if(movie_done || snatched && snatched > 0)
self.el = new Element('a.readd', { 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': { 'events': {
'click': self.doReadd.bind(self) 'click': self.doReadd.bind(self)
} }

Loading…
Cancel
Save