2014-03-10 05:18:05 +00:00
|
|
|
#import sickbeard
|
|
|
|
#from sickbeard.common import *
|
2015-03-21 17:47:16 +00:00
|
|
|
#set global $title = 'Mass Update'
|
|
|
|
#set global $header = 'Mass Update'
|
2014-03-10 05:18:05 +00:00
|
|
|
|
2015-03-21 17:47:16 +00:00
|
|
|
#set global $sbPath = '../..'
|
2014-03-10 05:18:05 +00:00
|
|
|
|
2015-03-21 17:47:16 +00:00
|
|
|
#set global $topmenu = 'manage'
|
2014-03-10 05:18:05 +00:00
|
|
|
#import os.path
|
2015-03-21 17:47:16 +00:00
|
|
|
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl')
|
2014-03-10 05:18:05 +00:00
|
|
|
|
2015-03-21 17:47:16 +00:00
|
|
|
#set $has_any_sports = False
|
|
|
|
#set $has_any_anime = False
|
|
|
|
#set $has_any_flat_folders = False
|
|
|
|
#set $myShowList = $sickbeard.showList
|
|
|
|
$myShowList.sort(lambda x, y: cmp(x.name, y.name))
|
|
|
|
#for $curShow in $myShowList
|
|
|
|
#set $has_any_sports |= bool($curShow.sports)
|
|
|
|
#set $has_any_anime |= bool($curShow.anime)
|
|
|
|
#set $has_any_flat_folders |= $bool(curShow.flatten_folders)
|
|
|
|
#end for
|
2014-03-10 05:18:05 +00:00
|
|
|
<script type="text/javascript" charset="utf-8">
|
|
|
|
<!--
|
|
|
|
\$.tablesorter.addParser({
|
2015-03-21 17:47:16 +00:00
|
|
|
id: 'showNames',
|
|
|
|
is: function(s) {
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
format: function(s) {
|
|
|
|
#if not $sickbeard.SORT_ARTICLE
|
2014-11-27 03:30:00 +00:00
|
|
|
return (s || '').replace(/^(?:(?:A(?!\s+to)n?)|The)\s(\w)/i, '$1');
|
2015-03-21 17:47:16 +00:00
|
|
|
#else
|
2014-03-10 05:18:05 +00:00
|
|
|
return (s || '');
|
|
|
|
#end if
|
2015-03-21 17:47:16 +00:00
|
|
|
},
|
|
|
|
type: 'text'
|
2014-03-10 05:18:05 +00:00
|
|
|
});
|
|
|
|
\$.tablesorter.addParser({
|
2015-03-21 17:47:16 +00:00
|
|
|
id: 'quality',
|
|
|
|
is: function(s) {
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
format: function(s) {
|
|
|
|
return s.replace('hd1080p', 5).replace('hd720p', 4).replace('hd', 3).replace('sd', 2).replace('any', 1).replace('best', 0).replace('custom', 7);
|
|
|
|
},
|
|
|
|
type: 'numeric'
|
2014-03-10 05:18:05 +00:00
|
|
|
});
|
|
|
|
|
2015-03-21 17:47:16 +00:00
|
|
|
#set $columns_total = 15 - ((1, 0)[$has_any_sports] + (1, 0)[$has_any_anime] + (1, 0)[$has_any_flat_folders] + (1, 0)[$sickbeard.USE_SUBTITLES])
|
|
|
|
#set $column_headers = [('false', False), ("'showNames'", False), ("'quality'", False),
|
|
|
|
((None, "'sports'")[$has_any_sports], True),
|
|
|
|
("'scene'", True), ((None, "'anime'")[$has_any_anime], True),
|
|
|
|
((None, "'flatfold'")[$has_any_flat_folders], True), ("'paused'", True),
|
|
|
|
("'status'", False), ('false', False), ('false', False), ('false', False),
|
|
|
|
((None, 'false')[$sickbeard.USE_SUBTITLES], False), ('false', False), ('false', False)]
|
|
|
|
#set $headers = []
|
|
|
|
#set $text_extract = []
|
|
|
|
#set $column = -1
|
|
|
|
#for $k, ($c, $img_extract) in enumerate($column_headers)
|
|
|
|
#if None is $c
|
|
|
|
#continue
|
|
|
|
#end if
|
|
|
|
#set $column += 1
|
|
|
|
$headers.append('\t\t\t%s: { sorter: %s }' % ($column, $c))
|
|
|
|
#if $img_extract
|
|
|
|
$text_extract.append('\t\t\t%s%s' % ($column, ": function(node) {return $(node).find('img').attr('alt')}"))
|
|
|
|
#end if
|
|
|
|
#end for
|
|
|
|
|
|
|
|
\$(document).ready(function()
|
|
|
|
{
|
|
|
|
\$('#massUpdateTable:has(tbody tr)').tablesorter({
|
|
|
|
widgets: ['zebra'],
|
|
|
|
sortList: [[1,0]],
|
|
|
|
headers: {
|
|
|
|
#echo ',\n'.join($headers)#
|
|
|
|
},
|
|
|
|
textExtraction: {
|
|
|
|
2: function(node) {return \$(node).find('span').text().toLowerCase()},
|
|
|
|
#echo ',\n'.join($text_extract)#
|
|
|
|
}
|
|
|
|
});
|
2014-03-10 05:18:05 +00:00
|
|
|
});
|
|
|
|
//-->
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript" src="$sbRoot/js/massUpdate.js?$sbPID"></script>
|
2015-03-21 17:47:16 +00:00
|
|
|
#if $varExists('header')
|
2014-03-10 05:18:05 +00:00
|
|
|
<h1 class="header">$header</h1>
|
2015-03-21 17:47:16 +00:00
|
|
|
#else
|
2014-03-10 05:18:05 +00:00
|
|
|
<h1 class="title">$title</h1>
|
|
|
|
#end if
|
|
|
|
<form name="massUpdateForm" method="post" action="massUpdate">
|
|
|
|
|
|
|
|
<table id="massUpdateTable" class="sickbeardTable tablesorter" cellspacing="1" border="0" cellpadding="0">
|
2014-09-30 22:20:37 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2015-03-21 17:47:16 +00:00
|
|
|
<th class="col-checkbox">Edit<br /><input type="checkbox" class="bulkCheck" id="editCheck"></th>
|
|
|
|
<th class="nowrap narrow" style="text-align:left">Show Name</th>
|
|
|
|
<th class="col-legend narrow">Quality</th>
|
|
|
|
#if $has_any_sports
|
|
|
|
<th class="col-legend narrow">Sports</th>
|
|
|
|
#end if
|
|
|
|
<th class="col-legend narrow">Scene</th>
|
|
|
|
#if $has_any_anime
|
|
|
|
<th class="col-legend narrow">Anime</th>
|
|
|
|
#end if
|
|
|
|
#if $has_any_flat_folders
|
|
|
|
<th class="col-legend narrow">Flat<br /> Folders</th>
|
|
|
|
#end if
|
|
|
|
<th class="col-legend narrow">Paused</th>
|
|
|
|
<th class="col-legend narrow">Status</th>
|
|
|
|
<th width="1%">Update<br /><input type="checkbox" class="bulkCheck" id="updateCheck"></th>
|
|
|
|
<th width="1%">Rescan<br /><input type="checkbox" class="bulkCheck" id="refreshCheck"></th>
|
|
|
|
<th width="1%">Rename<br /><input type="checkbox" class="bulkCheck" id="renameCheck"></th>
|
|
|
|
#if $sickbeard.USE_SUBTITLES
|
|
|
|
<th width="1%">Search<br />Subtitle<br /><input type="checkbox" class="bulkCheck" id="subtitleCheck"></th>
|
|
|
|
#end if
|
|
|
|
## <!-- <th>Force Metadata Regen <input type="checkbox" class="bulkCheck" id="metadataCheck"></th>//-->
|
|
|
|
<th width="1%">Delete<br /><input type="checkbox" class="bulkCheck" id="deleteCheck"></th>
|
|
|
|
<th width="1%">Remove<br /><input type="checkbox" class="bulkCheck" id="removeCheck"></th>
|
2014-09-30 22:20:37 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
2014-05-30 11:06:51 +00:00
|
|
|
|
2014-09-30 22:20:37 +00:00
|
|
|
<tfoot>
|
|
|
|
<tr>
|
2015-03-21 17:47:16 +00:00
|
|
|
<td rowspan="1" colspan="2" class="align-center alt"><input class="btn pull-left" type="button" value="Edit Selected" id="submitMassEdit"></td>
|
|
|
|
<td rowspan="1" colspan="#echo $columns_total-2#" class="align-right alt"><input class="btn pull-right" type="button" value="Submit" id="submitMassUpdate"></td>
|
2014-09-30 22:20:37 +00:00
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
|
|
|
|
<tbody>
|
2014-03-10 05:18:05 +00:00
|
|
|
|
2015-03-21 17:47:16 +00:00
|
|
|
#set $disabled = ' disabled="disabled"'
|
|
|
|
#set $disabled_inprogress_tip = ' title="%s action is currently in progress for this show"'
|
|
|
|
#set $disabled_subtitles_tip = ' title="Use edit to enable subtitle search for this show"'
|
|
|
|
#set $no = 'no16.png" title="No" alt="No'
|
|
|
|
#set $yes = 'yes16.png" title="Yes" alt="Yes'
|
|
|
|
#for $curShow in $myShowList
|
|
|
|
#set $option_state = '<input type="checkbox" class="%sCheck" id="%s-{0:s}"%s>'.format(str($curShow.indexerid))
|
|
|
|
#slurp
|
|
|
|
#set $curUpdate_disabled = $sickbeard.showQueueScheduler.action.isBeingUpdated($curShow)\
|
|
|
|
or $sickbeard.showQueueScheduler.action.isInUpdateQueue($curShow)
|
|
|
|
#set $reason = $disabled_inprogress_tip % 'Update'
|
|
|
|
#set $curUpdate = '%s>%s' % (('', $reason)[$curUpdate_disabled],
|
|
|
|
$option_state % ('update', 'update', ('', $disabled + $reason)[$curUpdate_disabled]))
|
|
|
|
#slurp
|
|
|
|
#set $curRefresh_disabled = $sickbeard.showQueueScheduler.action.isBeingRefreshed($curShow)\
|
|
|
|
or $sickbeard.showQueueScheduler.action.isInRefreshQueue($curShow)
|
|
|
|
#set $reason = $disabled_inprogress_tip % 'Rescan'
|
|
|
|
#set $curRefresh = '%s>%s' % (('', $reason)[$curRefresh_disabled],
|
|
|
|
$option_state % ('refresh', 'refresh', ('', $disabled + $reason)[$curRefresh_disabled]))
|
|
|
|
#slurp
|
|
|
|
#set $curRename_disabled = $sickbeard.showQueueScheduler.action.isBeingRenamed($curShow)\
|
|
|
|
or $sickbeard.showQueueScheduler.action.isInRenameQueue($curShow)
|
|
|
|
#set $reason = $disabled_inprogress_tip % 'Rename'
|
|
|
|
#set $curRename = '%s>%s' % (('', $reason)[$curRename_disabled],
|
|
|
|
$option_state % ('rename', 'rename', ('', $disabled + $reason)[$curRename_disabled]))
|
|
|
|
#slurp
|
|
|
|
#set $subtitles_disabled = not $curShow.subtitles\
|
|
|
|
or $sickbeard.showQueueScheduler.action.isBeingSubtitled($curShow)\
|
|
|
|
or $sickbeard.showQueueScheduler.action.isInSubtitleQueue($curShow)
|
|
|
|
#set $reason = ($disabled_inprogress_tip % 'Search subtitle', $disabled_subtitles_tip)[not $curShow.subtitles]
|
|
|
|
#set $curSubtitle = '%s>%s' % (('', $reason)[$subtitles_disabled],
|
|
|
|
$option_state % ('subtitle', 'subtitle', ('', $disabled + $reason)[$subtitles_disabled]))
|
|
|
|
#slurp
|
|
|
|
#set $curDelete_disabled = $sickbeard.showQueueScheduler.action.isBeingRenamed($curShow)\
|
|
|
|
or $sickbeard.showQueueScheduler.action.isInRenameQueue($curShow)\
|
|
|
|
or $sickbeard.showQueueScheduler.action.isInRefreshQueue($curShow)
|
|
|
|
#set $reason = $disabled_inprogress_tip % 'Rename or rescan'
|
|
|
|
#set $curDelete = '%s>%s' % (('', $reason)[$curDelete_disabled],
|
|
|
|
$option_state % ('delete', 'delete', ('', $disabled + $reason)[$curDelete_disabled]))
|
|
|
|
#slurp
|
|
|
|
#set $curRemove_disabled = $sickbeard.showQueueScheduler.action.isBeingRenamed($curShow)\
|
|
|
|
or $sickbeard.showQueueScheduler.action.isInRenameQueue($curShow)\
|
|
|
|
or $sickbeard.showQueueScheduler.action.isInRefreshQueue($curShow)
|
|
|
|
##set $reason = $disabled_inprogress_tip % 'Rename or rescan'
|
|
|
|
#set $curRemove = '%s>%s' % (('', $reason)[$curRemove_disabled],
|
|
|
|
$option_state % ('remove', 'remove', ('', $disabled + $reason)[$curRemove_disabled]))
|
2014-09-30 22:20:37 +00:00
|
|
|
<tr>
|
2015-03-21 17:47:16 +00:00
|
|
|
<td align="center"><input type="checkbox" class="editCheck" id="edit-$curShow.indexerid"></td>
|
2014-09-30 22:20:37 +00:00
|
|
|
<td class="tvShow"><a href="$sbRoot/home/displayShow?show=$curShow.indexerid">$curShow.name</a></td>
|
2015-03-21 17:47:16 +00:00
|
|
|
#if $curShow.quality in $qualityPresets
|
2014-09-30 22:20:37 +00:00
|
|
|
<td align="center"><span class="quality $qualityPresetStrings[$curShow.quality]">$qualityPresetStrings[$curShow.quality]</span></td>
|
2015-03-21 17:47:16 +00:00
|
|
|
#else
|
2014-09-30 22:20:37 +00:00
|
|
|
<td align="center"><span class="quality Custom">Custom</span></td>
|
2015-03-21 17:47:16 +00:00
|
|
|
#end if
|
|
|
|
#if $has_any_sports
|
|
|
|
<td align="center"><img src="$sbRoot/images/#if 1 == int($curShow.is_sports) then $yes else $no#" width="16" height="16" /></td>
|
|
|
|
#end if
|
|
|
|
<td align="center"><img src="$sbRoot/images/#if 1 == int($curShow.is_scene) then $yes else $no#" width="16" height="16" /></td>
|
|
|
|
#if $has_any_anime
|
|
|
|
<td align="center"><img src="$sbRoot/images/#if 1 == int($curShow.is_anime) then $yes else $no#" width="16" height="16" /></td>
|
|
|
|
#end if
|
|
|
|
#if $has_any_flat_folders
|
|
|
|
<td align="center"><img src="$sbRoot/images/#if 1 == int($curShow.flatten_folders) then $yes else $no#" width="16" height="16" /></td>
|
|
|
|
#end if
|
|
|
|
<td align="center"><img src="$sbRoot/images/#if 1 == int($curShow.paused) then $yes else $no#" width="16" height="16" /></td>
|
2014-09-30 22:20:37 +00:00
|
|
|
<td align="center">$curShow.status</td>
|
2015-03-21 17:47:16 +00:00
|
|
|
<td align="center"$curUpdate</td>
|
|
|
|
<td align="center"$curRefresh</td>
|
|
|
|
<td align="center"$curRename</td>
|
|
|
|
#if $sickbeard.USE_SUBTITLES
|
|
|
|
<td align="center"$curSubtitle</td>
|
|
|
|
#end if
|
|
|
|
<td align="center"$curDelete</td>
|
|
|
|
<td align="center"$curRemove</td>
|
2014-09-30 22:20:37 +00:00
|
|
|
</tr>
|
2015-03-21 17:47:16 +00:00
|
|
|
#end for
|
2014-09-30 22:20:37 +00:00
|
|
|
</tbody>
|
|
|
|
|
2014-03-10 05:18:05 +00:00
|
|
|
</table>
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
2015-03-21 17:47:16 +00:00
|
|
|
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl')
|