From 1398c38275f25f168c9961edb439f808bdabd44c Mon Sep 17 00:00:00 2001 From: echel0n Date: Sun, 11 May 2014 05:49:07 -0700 Subject: [PATCH] Fix for manual and backlog download/search issues. Removed multi-threading as it was more problems then usefull for now. Added in match & snatch, any quality from initial quality settings gets downloaded first and does not continue searching, if archive qualities exist it'll stop once it hits max quality from said list. --- gui/slick/interfaces/default/inc_bottom.tmpl | 4 +- lib/concurrent/futures/thread.py | 16 +- sickbeard/__init__.py | 38 +-- sickbeard/config.py | 1 - sickbeard/db.py | 2 + sickbeard/generic_queue.py | 15 +- sickbeard/name_parser/parser.py | 1 - sickbeard/providers/btn.py | 5 +- sickbeard/providers/generic.py | 4 +- sickbeard/providers/hdtorrents.py | 7 +- sickbeard/providers/iptorrents.py | 7 +- sickbeard/providers/kat.py | 8 +- sickbeard/providers/newznab.py | 56 ++++ sickbeard/providers/nextgen.py | 7 +- sickbeard/providers/publichd.py | 2 +- sickbeard/providers/scc.py | 7 +- sickbeard/providers/speedcd.py | 2 +- sickbeard/providers/thepiratebay.py | 7 +- sickbeard/providers/torrentday.py | 7 +- sickbeard/providers/torrentleech.py | 7 +- sickbeard/search.py | 7 +- sickbeard/search_queue.py | 275 +++++-------------- sickbeard/show_queue.py | 15 +- sickbeard/snatch_queue.py | 83 ++++++ sickbeard/tvcache.py | 141 ++++++---- sickbeard/webapi.py | 26 +- sickbeard/webserve.py | 13 - 27 files changed, 362 insertions(+), 401 deletions(-) create mode 100644 sickbeard/snatch_queue.py diff --git a/gui/slick/interfaces/default/inc_bottom.tmpl b/gui/slick/interfaces/default/inc_bottom.tmpl index 2ef35410..fd44b668 100644 --- a/gui/slick/interfaces/default/inc_bottom.tmpl +++ b/gui/slick/interfaces/default/inc_bottom.tmpl @@ -13,9 +13,7 @@ #set $numGoodShows = len([x for x in $sickbeard.showList if x.paused == 0 and x.status != "Ended"]) #set $numDLEpisodes = $myDB.select("SELECT COUNT(*) FROM tv_episodes WHERE status IN ("+",".join([str(x) for x in $Quality.DOWNLOADED + [$ARCHIVED]])+") AND season != 0 and episode != 0 AND airdate <= "+$today+"")[0][0] #set $numEpisodes = $myDB.select("SELECT COUNT(*) FROM tv_episodes WHERE season != 0 and episode != 0 AND (airdate != 1 OR status IN ("+",".join([str(x) for x in ($Quality.DOWNLOADED + $Quality.SNATCHED + $Quality.SNATCHED_PROPER) + [$ARCHIVED]])+")) AND airdate <= "+$today+" AND status != "+str($IGNORED)+"")[0][0] -$numShows shows ($numGoodShows active) | $numDLEpisodes/$numEpisodes episodes downloaded | -Search: <%=str(sickbeard.currentSearchScheduler.timeLeft()).split('.')[0]%> | - +$numShows shows ($numGoodShows active) | $numDLEpisodes/$numEpisodes episodes downloaded | Backlog: $sbdatetime.sbdatetime.sbfdate($sickbeard.backlogSearchScheduler.nextRun())