You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

327 lines
16 KiB

#import sickbeard
#from sickbeard.helpers import find_show_by_id, maybe_plural
#from sickbeard.sgdatetime import SGDatetime
##
#set global $title = 'Show Tasks'
#set global $header = 'Show Tasks'
#set global $sbPath = '..'
#set global $topmenu = 'manage'
#set $dev_mode = os.environ.get('SG_DEV_MODE')
##
#import os.path
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl')
<script type="text/javascript" src="$sbRoot/js/manageShowProcesses.js?v=$sbPID" xmlns="http://www.w3.org/1999/html"></script>
<div id="content800">
#if $varExists('header')
<h1 class="header">$header</h1>
#else
<h1 class="title">$title</h1>
#end if
<div id="summary2" class="align-left">
<h3>Daily show update:</h3>
<a id="showupdatebutton" class="btn#if $show_update_running# disabled#end if#" href="$sbRoot/manage/show-tasks/force-show-update"><i class="sgicon-play"></i> Force</a>
#if not $show_update_running:
Not in progress (Next run: $SGDatetime.sbftime($next_run))<br />
#else:
Currently running<br />
#end if
<br>
#if $not_found_shows
#set $num_errors = $len($not_found_shows)
#set $err_class = ('', ' errors ' + ($num_errors * 'n')[0:4])[any([$num_errors])]
<h3>$num_errors Show$maybe_plural($num_errors) with abandoned master ID$maybe_plural($num_errors):</h3>
<p>List of show(s) with changed ID at the TV info source. Click show name to get new ID, so that episode info updates may continue</p>
<input type="button" class="shows-more btn" id="notfound-btn-more" value="Expand" style="display:none"><input type="button" class="shows-less btn" id="notfound-btn-less" value="Collapse"><br>
<table class="sickbeardTable tablesorter manageTable" cellspacing="1" border="0" cellpadding="0">
<thead>
<tr>
<th style="text-align:left">Show name</th>
<th style="width:20%;white-space:nowrap">Last found</th>
<th style="width:10%;white-space:nowrap">Ignore Warn</th>
</tr>
</thead>
<tbody>
#set $row = 0
#for $cur_show in $not_found_shows:
<tr class="#echo ('odd', 'even')[$row % 2]##set $row+=1#">
<td style="text-align:left">
<span style="padding-right:5px" class="logger item snf"><i class="sgicon-warning"></i></span><a class="whitelink" href="$sbRoot/home/edit-show?tvid_prodid=$cur_show['tvid_prodid']&tvsrc=0&srcid=$cur_show['prodid']#core-component-group3">$cur_show['show_name']</a>
</td>
<td style="text-align:center;color:white">
$cur_show['last_success']</td>
<td>
<input class="nowarnicon" type="checkbox" #if $cur_show['ignore_warning'] then 'checked="checked"' else ''# data-tvid-prodid="$cur_show['tvid_prodid']">
</td>
</tr>
#end for
</tbody>
<tfoot>
<tr>
<td colspan="2" style="text-align:right"><span>Note: Ignored shows will still not get updates unless edited</span></td>
<td>
<input id="save-nowarnicon" type="button" class="btn" value="Save">
</td>
</tr>
</tfoot>
</table>
#end if
#if $defunct_indexer
<h3>Shows from defunct TV info sources:</h3>
<input type="button" class="shows-more btn" id="defunct-btn-more" value="Expand" style="display:none"><input type="button" class="shows-less btn" id="defunct-btn-less" value="Collapse"><br>
<table class="sickbeardTable manageTable" cellspacing="1" border="0" cellpadding="0">
<thead>
<tr>
<th style="text-align:left">Show name</th>
</tr>
</thead>
<tbody>
#set $row = 0
#for $cur_show in $defunct_indexer:
<tr class="#echo ('odd', 'even')[$row % 2]##set $row+=1#">
<td style="text-align:left">
<a class="whitelink" href="$sbRoot/home/view-show?tvid_prodid=$cur_show['tvid_prodid']">$cur_show['show_name']</a>
</td>
</tr>
#end for
</tbody>
</table>
#end if
<h3>Show queue:</h3>
#if $queue_length['add'] or $queue_length['update'] or $queue_length['refresh'] or $queue_length['rename'] or $queue_length['subtitle']
<br>
<input type="button" class="show-all-more btn" id="all-btn-more" value="Expand All"><input type="button" class="show-all-less btn" id="all-btn-less" value="Collapse All"><br>
#end if
<br>
Add: <i>$len($queue_length['add']) show$sickbeard.helpers.maybe_plural($len($queue_length['add']))</i> #if $dev_mode #<input type="button" class="btn" id="clear-btn-add" value="Clear" data-action="$sickbeard.show_queue.ShowQueueActions.ADD">#end if#
#if $queue_length['add']
<input type="button" class="shows-more btn" id="add-btn-more" value="Expand" #if not $queue_length['add']# style="display:none" #end if#><input type="button" class="shows-less btn" id="add-btn-less" value="Collapse" style="display:none"><br>
<table class="sickbeardTable manageTable" cellspacing="1" border="0" cellpadding="0" style="display:none">
<thead>
<tr>
<th style="width:80%;text-align:left">Show name</th>
<th style="width:20%">&nbsp;</th>
</tr>
</thead>
<tbody>
#set $row = 0
#for $cur_show in $queue_length['add']:
#set $show_name = str($cur_show['name'])
<tr class="#echo ('odd', 'even')[$row % 2]##set $row+=1#">
<td style="text-align:left;color:white">$show_name</td>
<td style="text-align:center;color:white">#if $cur_show['scheduled_update']#Scheduled#end if##if $dev_mode #<input type="button" class="btn" id="remove-btn-$cur_show['uid']" value="Remove" data-uid="$cur_show['uid']">#end if#</td>
</tr>
#end for
</tbody>
</table>
#else
<br>
#end if
<br>
Update <span class="grey-text">(Forced / Forced Web)</span>: <i>$len($queue_length['update']) <span class="grey-text">($len($queue_length['forceupdate']) / $len($queue_length['forceupdateweb']))</span> show$sickbeard.helpers.maybe_plural($len($queue_length['update']))</i> #if $dev_mode #<input type="button" class="btn" id="clear-btn-update" value="Clear" data-action="$sickbeard.show_queue.ShowQueueActions.UPDATE">#end if#
#if $queue_length['update']
<input type="button" class="shows-more btn" id="update-btn-more" value="Expand" #if not $queue_length['update']# style="display:none" #end if#><input type="button" class="shows-less btn" id="update-btn-less" value="Collapse" style="display:none"><br>
<table class="sickbeardTable manageTable" cellspacing="1" border="0" cellpadding="0" style="display:none">
<thead>
<tr>
<th style="width:80%;text-align:left">Show name</th>
<th style="width:20%">Schedule type</th>
</tr>
</thead>
<tbody>
#set $row = 0
#for $cur_show in $queue_length['update']:
#set $show_name = $cur_show['name']
#if not $cur_show['name']
#set $show_obj = $find_show_by_id({$cur_show['tvid']: $cur_show['prodid']})
#if $show_obj
#set $show_name = $show_obj.name
#end if
#end if
<tr class="#echo ('odd', 'even')[$row % 2]##set $row+=1#">
<td style="text-align:left">
<a class="whitelink" href="$sbRoot/home/view-show?tvid_prodid=$cur_show['tvid_prodid']">$show_name</a>
</td>
<td style="text-align:center;color:white">#if $cur_show['scheduled_update']#Scheduled, #end if#$cur_show['update_type']#if $dev_mode #<input type="button" class="btn" id="remove-btn-$cur_show['uid']" value="Remove" data-uid="$cur_show['uid']">#end if#</td>
</tr>
#end for
</tbody>
</table>
#else
<br>
#end if
<br>
Refresh: <i>$len($queue_length['refresh']) show$sickbeard.helpers.maybe_plural($len($queue_length['refresh']))</i> #if $dev_mode #<input type="button" class="btn" id="clear-btn-refreah" value="Clear" data-action="$sickbeard.show_queue.ShowQueueActions.REFRESH">#end if#
#if $queue_length['refresh']
<input type="button" class="shows-more btn" id="refresh-btn-more" value="Expand" #if not $queue_length['refresh']# style="display:none" #end if#><input type="button" class="shows-less btn" id="refresh-btn-less" value="Collapse" style="display:none"><br>
<table class="sickbeardTable manageTable" cellspacing="1" border="0" cellpadding="0" style="display:none">
<thead>
<tr>
<th style="width:80%;text-align:left">Show name</th>
<th style="width:20%">Schedule type</th>
</tr>
</thead>
<tbody>
#set $row = 0
#for $cur_show in $queue_length['refresh']:
<tr class="#echo ('odd', 'even')[$row % 2]##set $row+=1#">
<td style="text-align:left">
<a class="whitelink" href="$sbRoot/home/view-show?tvid_prodid=$cur_show['tvid_prodid']">$cur_show['name']</a>
</td>
<td style="text-align:center;color:white">#if $cur_show['scheduled_update']#Scheduled#end if##if $dev_mode #<input type="button" class="btn" id="remove-btn-$cur_show['uid']" value="Remove" data-uid="$cur_show['uid']">#end if#</td>
</tr>
#end for
</tbody>
</table>
#else
<br>
#end if
<br>
Switch Source: <i>$len($queue_length['switch']) show$sickbeard.helpers.maybe_plural($len($queue_length['switch']))</i> #if $dev_mode #<input type="button" class="btn" id="clear-btn-swtich" value="Clear" data-action="$sickbeard.show_queue.ShowQueueActions.SWITCH">#end if#
#if $queue_length['switch']
<input type="button" class="shows-more btn" id="switch-btn-more" value="Expand" #if not $queue_length['switch']# style="display:none" #end if#><input type="button" class="shows-less btn" id="switch-btn-less" value="Collapse" style="display:none"><br>
<table class="sickbeardTable manageTable" cellspacing="1" border="0" cellpadding="0" style="display:none">
<thead>
<tr>
<th style="width:80%;text-align:left">Show name</th>
<th style="width:20%">New TV Source</th>
</tr>
</thead>
<tbody>
#set $row = 0
#for $cur_show in $queue_length['switch']:
<tr class="#echo ('odd', 'even')[$row % 2]##set $row+=1#">
<td style="text-align:left">
<a class="whitelink" href="$sbRoot/home/view-show?tvid_prodid=$cur_show['tvid_prodid']">$cur_show['name']</a>
</td>
<td style="text-align:center;color:white">$sickbeard.TVInfoAPI($cur_show['new_tvid']).name#if $dev_mode #<input type="button" class="btn" id="remove-btn-$cur_show['uid']" value="Remove" data-uid="$cur_show['uid']">#end if#</td>
</tr>
#end for
</tbody>
</table>
#else
<br>
#end if
<br>
Switch Failed: <i>$len($failed_switch) show$sickbeard.helpers.maybe_plural($len($failed_switch))</i>
#if $failed_switch
<input type="button" class="shows-more btn" id="switch-failed-btn-more" value="Expand" #if not $failed_switch# style="display:none" #end if#><input type="button" class="shows-less btn" id="switch-failed-btn-less" value="Collapse" style="display:none"><br>
<table class="sickbeardTable manageTable" cellspacing="1" border="0" cellpadding="0" style="display:none">
<thead>
<tr>
<th style="width:60%;text-align:left">Show name</th>
<th style="width:20%">New TV Source</th>
<th style="width:20%">Fail Reason</th>
</tr>
</thead>
<tbody>
#set $row = 0
#for $cur_show in $failed_switch:
<tr class="#echo ('odd', 'even')[$row % 2]##set $row+=1#">
<td style="text-align:left">
#if $cur_show['show_obj']
<a class="whitelink" href="$sbRoot/home/view-show?tvid_prodid=$cur_show['show_obj'].tvid_prodid">$cur_show['show_obj'].name</a>
#else
<span>Unknown Show: $cur_show['old_tvid']:$cur_show['old_prodid']</span>
#end if
</td>
<td style="text-align:center;color:white">$sickbeard.TVInfoAPI($cur_show['new_tvid']).name</td>
<td style="text-align: center;color:white">
$cur_show['status'] <input type="button" class="btn" id="remove-btn-$cur_show['uid']" value="Remove" data-uid="$cur_show['uid']" data-force="1">
</td>
</tr>
#end for
</tbody>
</table>
#else
<br>
#end if
<br>
People: <i>$len($people_queue['main_cast']) show$sickbeard.helpers.maybe_plural($len($people_queue['main_cast']))</i> #if $dev_mode #<input type="button" class="btn" id="clear-people-btn" value="Clear" data-action="$sickbeard.people_queue.PeopleQueueActions.SHOWCAST">#end if#
#if $people_queue['main_cast']
<input type="button" class="shows-more btn" id="main_cast-btn-more" value="Expand" #if not $people_queue['main_cast']# style="display:none" #end if#><input type="button" class="shows-less btn" id="main_cast-btn-less" value="Collapse" style="display:none"><br>
<table class="sickbeardTable manageTable" cellspacing="1" border="0" cellpadding="0" style="display:none">
<thead>
<tr>
<th style="width:80%;text-align:left">Show name</th>
<th style="width:20%">People type</th>
</tr>
</thead>
<tbody>
#set $row = 0
#for $cur_show in $people_queue['main_cast']:
<tr class="#echo ('odd', 'even')[$row % 2]##set $row+=1#">
<td style="text-align:left">
<a class="whitelink" href="$sbRoot/home/view-show?tvid_prodid=$cur_show['tvid_prodid']">$cur_show['name']</a>
</td>
<td style="text-align:center;color:white">Main Cast#if $dev_mode #<input type="button" class="btn" id="remove-people-btn-$cur_show['uid']" value="Remove" data-uid="$cur_show['uid']">#end if#</td>
</tr>
#end for
</tbody>
</table>
#else
<br>
#end if
<br>
Rename: <i>$len($queue_length['rename']) show$sickbeard.helpers.maybe_plural($len($queue_length['rename']))</i> #if $dev_mode #<input type="button" class="btn" id="clear-btn-rename" value="Clear" data-action="$sickbeard.show_queue.ShowQueueActions.RENAME">#end if#
#if $queue_length['rename']
<input type="button" class="shows-more btn" id="rename-btn-more" value="Expand" #if not $queue_length['rename']# style="display:none" #end if#><input type="button" class="shows-less btn" id="rename-btn-less" value="Collapse" style="display:none"><br>
<table class="sickbeardTable manageTable" cellspacing="1" border="0" cellpadding="0" style="display:none">
<thead>
<tr>
<th style="width:80%;text-align:left">Show name</th>
<th style="width:20%">Schedule type</th>
</tr>
</thead>
<tbody>
#set $row = 0
#for $cur_show in $queue_length['rename']:
<tr class="#echo ('odd', 'even')[$row % 2]##set $row+=1#">
<td style="text-align:left">
<a class="whitelink" href="$sbRoot/home/view-show?tvid_prodid=$cur_show['tvid_prodid']">$cur_show['name']</a>
</td>
<td style="text-align:center;color:white">#if $cur_show['scheduled_update']#Scheduled#end if##if $dev_mode #<input type="button" class="btn" id="remove-btn-$cur_show['uid']" value="Remove" data-uid="$cur_show['uid']">#end if#</td>
</tr>
#end for
</tbody>
</table>
#else
<br>
#end if
#if $sickbeard.USE_SUBTITLES
<br>
Subtitle: <i>$len($queue_length['subtitle']) show$sickbeard.helpers.maybe_plural($len($queue_length['subtitle']))</i> #if $dev_mode #<input type="button" class="btn" id="clear-btn-subtitles" value="Clear" data-action="$sickbeard.show_queue.ShowQueueActions.SUBTITLE">#end if#
#if $queue_length['subtitle']
<input type="button" class="shows-more btn" id="subtitle-btn-more" value="Expand" #if not $queue_length['subtitle']# style="display:none" #end if#><input type="button" class="shows-less btn" id="subtitle-btn-less" value="Collapse" style="display:none"><br>
<table class="sickbeardTable manageTable" cellspacing="1" border="0" cellpadding="0" style="display:none">
<thead>
<tr>
<th style="width:80%;text-align:left">Show name</th>
<th style="width:20%">Schedule type</th>
</tr>
</thead>
<tbody>
#set $row = 0
#for $cur_show in $queue_length['subtitle']:
<tr class="#echo ('odd', 'even')[$row % 2]##set $row+=1#">
<td style="text-align:left">
<a class="whitelink" href="$sbRoot/home/view-show?tvid_prodid=$cur_show['tvid_prodid']">$cur_show['name']</a>
</td>
<td style="text-align:center;color:white">#if $cur_show['scheduled_update']#Scheduled#end if##if $dev_mode #<input type="button" class="btn" id="remove-btn-$cur_show['uid']" value="Remove" data-uid="$cur_show['uid']">#end if#</td>
</tr>
#end for
</tbody>
</table>
#else
<br>
#end if
#end if
</div>
</div>
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl')