From 74d701e6dae52cb75652ed0642577fa2e07a0cc3 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Tue, 10 Mar 2015 00:26:46 +0000 Subject: [PATCH] Change "Force Backlog" button for paused shows on Backlog Overview page to "Paused" indicator. --- CHANGES.md | 1 + .../default/manage_backlogOverview.tmpl | 59 +++++++++++-------- sickbeard/helpers.py | 2 +- sickbeard/webserve.py | 30 ++++++---- 4 files changed, 53 insertions(+), 39 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index cd6111c6..87c62c45 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -20,6 +20,7 @@ * Add Unknown status query to Episode Status Management * Fix Episode Status Management error popup from coming up when show is selected without expanding * Add BET network logo +* Change "Force Backlog" button for paused shows on Backlog Overview page to "Paused" indicator * Remove unused force variable from code and PEP8 * Change browser, bs4 parser and classes code to PEP8 standards * Change common and config code to PEP8 standards diff --git a/gui/slick/interfaces/default/manage_backlogOverview.tmpl b/gui/slick/interfaces/default/manage_backlogOverview.tmpl index 80bfad2d..99eb94f2 100644 --- a/gui/slick/interfaces/default/manage_backlogOverview.tmpl +++ b/gui/slick/interfaces/default/manage_backlogOverview.tmpl @@ -7,7 +7,7 @@ #set global $sbPath = '..' -#set global $topmenu = 'manage'# +#set global $topmenu = 'manage' #import os.path #include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl') @@ -29,7 +29,7 @@ dateHasTime : false, dateFormat : '${sickbeard.DATE_PRESET}', timeFormat : '${sickbeard.TIME_PRESET}', - trimZero : #if $sickbeard.TRIM_ZERO then "true" else "false"# + trimZero : #if $sickbeard.TRIM_ZERO then 'true' else 'false'# }); #end if @@ -44,70 +44,77 @@ #else

$title

#end if + #set $totalWanted = 0 #set $totalQual = 0 #for $curShow in $sickbeard.showList: -#set $totalWanted = $totalWanted + $showCounts[$curShow.indexerid][$Overview.WANTED] -#set $totalQual = $totalQual + $showCounts[$curShow.indexerid][$Overview.QUAL] + #set $totalWanted += $showCounts[$curShow.indexerid][$Overview.WANTED] + #set $totalQual += $showCounts[$curShow.indexerid][$Overview.QUAL] #end for
Wanted: $totalWanted Low Quality: $totalQual -

+ +
Jump to Show +#for $curShow in sorted($sickbeard.showList, key = operator.attrgetter('name')): + #if 0 != $showCounts[$curShow.indexerid][$Overview.QUAL] + $showCounts[$curShow.indexerid][$Overview.WANTED]: + + #end if +#end for +
#for $curShow in sorted($sickbeard.showList, key = operator.attrgetter('name')): -#if $showCounts[$curShow.indexerid][$Overview.QUAL] + $showCounts[$curShow.indexerid][$Overview.WANTED] == 0: -#continue -#end if + #if 0 == $showCounts[$curShow.indexerid][$Overview.QUAL] + $showCounts[$curShow.indexerid][$Overview.WANTED]: + #continue + #end if -#for $curResult in $showSQLResults[$curShow.indexerid]: - #set $whichStr = $str($curResult['season']) + 'x' + $str($curResult['episode']) - #try: - #set $overview = $showCats[$curShow.indexerid][$whichStr] - #except Exception - #continue - #end try + #for $curResult in $showSQLResults[$curShow.indexerid]: + #set $whichStr = $str($curResult['season']) + 'x' + $str($curResult['episode']) + #try: + #set $overview = $showCats[$curShow.indexerid][$whichStr] + #except Exception + #continue + #end try - #if $overview not in ($Overview.QUAL, $Overview.WANTED): - #continue - #end if + #if $overview not in ($Overview.QUAL, $Overview.WANTED): + #continue + #end if -#end for + #end for #end for
-

$curShow.name

+
+

$curShow.name

Wanted: $showCounts[$curShow.indexerid][$Overview.WANTED] Low Quality: $showCounts[$curShow.indexerid][$Overview.QUAL] + #if not $curShow.paused: Force Backlog + #else + Paused + #end if
EpisodeNameAirdate
$whichStr $curResult["name"]
#if int($curResult['airdate']) == 1 then 'never' else $sbdatetime.sbdatetime.sbfdate($sbdatetime.sbdatetime.convert_to_setting($network_timezones.parse_date_time($curResult['airdate'],$curShow.airs,$curShow.network)))#
diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 548cfb6d..7bff89b6 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -1025,7 +1025,7 @@ def _check_against_names(nameInQuestion, show, season=-1): def get_show(name, tryIndexers=False): - if not sickbeard.showList: + if not sickbeard.showList or None is name: return showObj = None diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 341e9519..29b154df 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -1533,24 +1533,30 @@ class Home(MainHandler): myDB = db.DBConnection() myDB.mass_action(sql_l) - if int(status) == WANTED: - msg = 'Backlog was automatically started for the following seasons of ' + showObj.name + ':
' - msg += '' + (title, msg) = (('Not starting backlog', u'Paused show prevented backlog search'), + ('Backlog started', u'Backlog search started'))[not showObj.paused] if segments: - ui.notifications.message('Backlog started', msg) + ui.notifications.message(title, + u'%s for the following seasons of %s:
' + % (msg, showObj.name, season_list)) - if int(status) == FAILED: + elif FAILED == int(status): msg = 'Retrying Search was automatically started for the following season of ' + showObj.name + ':
' msg += '