From 2cd72ad4e8f5dab9474ca43b54ac1b41d2e19580 Mon Sep 17 00:00:00 2001 From: echel0n Date: Thu, 11 Dec 2014 13:33:20 -0800 Subject: [PATCH] Fixed small cosmetic bug with trakt trending shows page. KAT torrent provider now gets and stores size and publishing date info. Fixed feedcache issue with KAT torrent provider Added timeout for trakt trending shows page --- gui/slick/js/addTrendingShow.js | 20 +++++++++++++++----- sickbeard/webserve.py | 3 ++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/gui/slick/js/addTrendingShow.js b/gui/slick/js/addTrendingShow.js index 3122e385..137acce0 100644 --- a/gui/slick/js/addTrendingShow.js +++ b/gui/slick/js/addTrendingShow.js @@ -1,10 +1,20 @@ $(document).ready(function() { - function loadContent() { - $('#trendingShows').html(' loading trending shows...'); - $.get(sbRoot+'/home/addShows/getTrendingShows/', function(data) { - $('#trendingShows').html(data); - }); + var trendingRequestXhr = null; + function loadContent() { + if (trendingRequestXhr) trendingRequestXhr.abort(); + + $('#trendingShows').html(' loading trending shows...'); + trendingRequestXhr = $.ajax({ + url: sbRoot + '/home/addShows/getTrendingShows/', + timeout: 60 * 1000, + error: function () { + $('#trendingShows').empty().html('Trakt timed out, refresh page to try again'); + }, + success: function (data) { + $('#trendingShows').html(data); + } + }); } loadContent(); diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index e3e2c168..bdac89e2 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -2249,7 +2249,8 @@ class HomeAddShows(Home): trakt_api = TraktAPI(sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD) try: - for show in trakt_api.traktRequest("shows/trending.json/%APIKEY%") or []: + shows = trakt_api.traktRequest("shows/trending.json/%APIKEY%") or [] + for show in shows: try: if not helpers.findCertainShow(sickbeard.showList, [int(show['tvdb_id']), int(show['tvrage_id'])]):