Add changeable master Show ID when show no longer found at TV info source.

Add guiding links to assist user to change TV Info Source ID.
Change Edit Show/Other to expose editing of master ID field *when* required.
Change add feature to search for a replacement master ID *when* required.
This commit is contained in:
JackDandy 2017-08-16 20:15:19 +01:00
parent 3bd392e671
commit 23fd0bb3a9
10 changed files with 205 additions and 141 deletions

View file

@ -99,6 +99,13 @@
* Change existing shows in DB are no longer selectable in result list
* Change add image to search result item hover over
* Change improve image load speed on browse Trakt/IMDb/AniDB pages
* Add a changeable master Show ID when show no longer found at TV info source due to an ID change
* Add guiding links to assist user to change TV Info Source ID
* Add "Shows with abandoned master IDs" to Manage/Show Processes Page to link shows that can have their show IDs
adjusted in order to sustain TV info updates
* Add "Shows from defunct TV info sources" to Manage/Show Processes page to link shows that can be switched to a
different default TV info source
* Add shows not found at a TV info source for over 7 days will only be retried once a week
[develop changelog]

View file

@ -4147,6 +4147,13 @@ fieldset.sectionwrap{
margin-top:10px
}
.fullwidth,
.fullwidth div.stepsguide,
.fullwidth div.stepsguide .step{
width:100%;
cursor:default
}
div.stepsguide .step,
legend.legendStep{
margin-bottom:0

View file

@ -20,7 +20,7 @@
#include $os.path.join($sg_str('PROG_DIR'), 'gui/slick/interfaces/default/inc_top.tmpl')
<script>
var config = {showLang: '$show.lang', showIsAnime: #echo ('!1','!0')[$show.is_anime]#}
var config = {showLang: '$show.lang', showIsAnime: #echo ('!1','!0')[$show.is_anime]#, expandIds: #echo ('!1','!0')[$expand_ids]#}
</script>
<script type="text/javascript" src="$sbRoot/js/qualityChooser.js?v=$sbPID"></script>
<script type="text/javascript" src="$sbRoot/js/editShow.js?v=$sbPID"></script>
@ -301,7 +301,7 @@
#set $dev = True
#set $dev = None
<div id="idmapping-options" style="display:#if $dev#--#end if#none">
#set $is_master_settable = False
#set $is_master_settable = False | $unlock_master_id
#for $src_id, $src_name in $sickbeard.indexerApi().all_indexers.iteritems()
#set $is_master_settable |= ($dev or
($src_id != $show.indexer and $show.ids[$src_id].get('id', 0) > 0 and
@ -328,13 +328,23 @@
#set $data_link = ''
#set $use_search_url = False
#end if
<a id="src-mid-$src_id" class="service" style="margin-right:6px" data-search="#if $use_search_url#y#else#n#end if#" #if $src_search_url#data-search-href="$anon_url($src_search_url % $search_name)" data-search-onclick="window.open(this.href, '_blank'); return !1;" data-search-title="Search for show at $src_name" #end if##if $use_search_url#href="$anon_url($src_search_url % $search_name)" onclick="window.open(this.href, '_blank'); return !1;" title="Search for show at $src_name" #end if#$(data_link)href="$anon_url(sickbeard.indexerApi($src_id).config['show_url'], $show.ids[$src_id]['id'])" $(data_link)onclick="window.open(this.href, '_blank'); return !1;" $(data_link)title="View $src_name info in new tab"><img alt="$src_name" height="16" width="16" src="$sbRoot/images/$sickbeard.indexerApi($src_id).config['icon']" /></a>
<a id="src-mid-$src_id" class="service" style="margin-right:6px" data-search="#if $use_search_url#y#else#n#end if#" #if $src_search_url#data-search-href="$anon_url($src_search_url % $search_name)" data-search-onclick="window.open(this.href, '_blank'); return !1;" data-search-title="Search for show at $src_name" #end if##if $use_search_url#href="$anon_url($src_search_url % $search_name)" onclick="window.open(this.href, '_blank'); return !1;" title="Search for show at $src_name" #end if#$(data_link)href="$anon_url(sickbeard.indexerApi($src_id).config['show_url'], ($show.ids[$src_id]['id'], $srcid)[$expand_ids and ($src_id == $tvsrc)])" $(data_link)onclick="window.open(this.href, '_blank'); return !1;" $(data_link)title="View $src_name info in new tab"><img alt="$src_name" height="16" width="16" src="$sbRoot/images/$sickbeard.indexerApi($src_id).config['icon']" /></a>
#end if
$src_name
</span>
<span class="component-desc">
<input type="text" data-maybe-master="#echo ('0', '1')[bool($maybe_master)]#" name="mid-$src_id" id="#echo ('mid-%s' % $src_id, 'source-id')[$src_id == $show.indexer]#" value="$show.ids.get($src_id, {'id': 0}).get('id')" class="form-control form-control-inline input-sm" #echo ('', $html_disabled)[$src_id == $show.indexer]#>
#if $src_id != $show.indexer
#set $current_showid = $show.ids.get($src_id, {'id': 0}).get('id')
<input type="text" data-maybe-master="#echo ('0', '1')[bool($maybe_master)]#" name="mid-$src_id" id="#echo ('mid-%s' % $src_id, 'source-id')[$src_id == $show.indexer]#" value="#echo ($current_showid, $srcid)[$expand_ids and ($src_id == $tvsrc)]#" class="form-control form-control-inline input-sm#if $src_id == $show.indexer and $unlock_master_id# warning#end if#" #echo ('', $html_disabled)[$src_id == $show.indexer and not $unlock_master_id]#>
#if $src_id == $show.indexer
<label for="the-master">
#if $is_master_settable
<input type="radio" name="set-master" id="the-master" checked data-indexer="$src_id" data-indexerid="$show.ids[$src_id].get('id', 0)">
#end if
<p#if $is_master_settable# style="padding-left:19px"#end if#>#if $unlock_master_id#master id may have changed, <a href="$sbRoot/home/addShows/new_show?show_to_add=$show.indexer|||$showname_enc&use_show_name=True&action=Find&return_to=$sbRoot%2Fhome%2FeditShow%3Fshow%3D$current_showid%26tvsrc%3D%25s%26srcid%3D%25s%23core-component-group3">search replacement here</a>#else#locked master, can't be edited#end if#</p>
</label>
#else
<label for="lockid-$src_id">
<input type="checkbox" name="lockid-$src_id" id="lockid-$src_id"#echo ('', $html_checked)[$show.ids.get($src_id, {'status': $sickbeard.indexermapper.MapStatus.NONE}).get('status') == $sickbeard.indexermapper.MapStatus.NO_AUTOMATIC_CHANGE]#>
<p style="padding-left:19px;margin-right:24px">lock this ID</p>
@ -344,13 +354,6 @@
<input type="radio" name="set-master" id="set-master-$src_id" data-indexer="$src_id" data-indexerid="$show.ids[$src_id].get('id', 0)">set master
</label>
#end if
#else
<label for="the-master">
#if $is_master_settable
<input type="radio" name="set-master" id="the-master" checked>
#end if
<p#if $is_master_settable# style="padding-left:19px"#end if#>locked master, can't be edited</p>
</label>
#end if
</span>
</div>

View file

@ -1,8 +1,8 @@
#import sickbeard
#from sickbeard.helpers import anon_url
##
#set global $header = 'Add from TV info source'
#set global $title = $header
#set global $header = ('Add from TV info source', '<span class="grey-text">%s::</span>%s' % ($kwargs.get('action'), $default_show_name))[any([$kwargs.get('action')])]
#set global $title = ('Add from TV info source', '%s::%s' % ($kwargs.get('action'), $default_show_name))[any([$kwargs.get('action')])]
#set global $sbPath = '../..'
#set global $statpath = '../..'
#set global $topmenu = 'home'
@ -33,38 +33,47 @@
<h1 class="title">$title</h1>
#end if
<image class="preload-image" style="position:absolute;top:-999px" src="$sbRoot/images/loading32#echo ('', '-dark')['dark' == $sg_str('THEME_NAME', 'dark')]#.gif" width="32" height="32" border="0">
<span class="preload-image" style="position:absolute;top:-999px" src="$sbRoot/images/loading32#echo ('', '-dark')['dark' == $sg_str('THEME_NAME', 'dark')]#.gif" width="32" height="32" border="0"></span>
<div id="newShowPortal">
#if not $kwargs.get('action')
<div id="displayText">aoeu</div>
<br />
<br>
#end if
<form id="addShowForm" method="post" action="$sbRoot/home/addShows/addNewShow" accept-charset="utf-8">
<form id="addShowForm"#if $kwargs.get('action')# class="fullwidth"#end if# method="post" action="$sbRoot/home/addShows/addNewShow" accept-charset="utf-8">
<fieldset class="sectionwrap step-one">
<legend class="legendStep"><p>#if $use_provided_info#Using known show information#else#Find show at TV info source#end if#</p></legend>
<div class="stepDiv">
<input type="hidden" id="indexer_timeout" value="$sg_var('INDEXER_TIMEOUT', 20)" />
<input type="hidden" id="indexer_count" value="$indexer_count" />
<input type="hidden" id="indexer_timeout" value="$sg_var('INDEXER_TIMEOUT', 20)">
<input type="hidden" id="indexer_count" value="$indexer_count">
#if $kwargs.get('action')
<input type="hidden" name="providedIndexer" value="$provided_indexer">
<input type="hidden" name="return_to" value="$kwargs.get('return_to')">
<input type="hidden" name="cancel_form" value="0">
<style>
.formpaginate .next{visibility:hidden !important}
</style>
#end if
#if $use_provided_info
#set $provided_indexer_local = $provided_indexer
#set $provided_indexer_id_local = $provided_indexer_id
Show: <a href="<%= anon_url(sickbeard.indexerApi(provided_indexer_local).config['show_url'], provided_indexer_id_local) %>">$provided_indexer_name</a>
<input type="hidden" name="indexerLang" value="en" />
<input type="hidden" name="whichSeries" value="#echo '|'.join([str($provided_indexer), '', str($provided_indexer_id), $provided_indexer_name])#" />
<input type="hidden" id="providedName" value="$provided_indexer_name" />
<input type="hidden" id="providedIndexer" value="$provided_indexer" />
<input type="hidden" name="indexerLang" value="en">
<input type="hidden" name="whichSeries" value="#echo '|'.join([str($provided_indexer), '', str($provided_indexer_id), $provided_indexer_name])#">
<input type="hidden" id="providedName" value="$provided_indexer_name">
<input type="hidden" id="providedIndexer" value="$provided_indexer">
#else
#if 2 > $len($indexers)
<style>
#addShowForm input#nameToSearch{width:611px}
</style>
<input type="hidden" id="providedIndexer" value="$provided_indexer" />
<input type="hidden" id="providedIndexer" value="$provided_indexer">
#end if
<input type="text" id="nameToSearch" value="$default_show_name" placeholder="Enter a show name, TVDB ID, IMDb Url, or IMDb ID" class="form-control form-control-inline input-sm input350" />
<input type="text" id="nameToSearch" value="$default_show_name" placeholder="Enter a show name, TVDB ID, IMDb Url, or IMDb ID" class="form-control form-control-inline input-sm input350">
&nbsp;
<span style="float:right">
<select name="indexerLang" id="indexerLangSelect" class="form-control form-control-inline input-sm">
@ -80,9 +89,9 @@
</select>
#end if
&nbsp;
<input class="btn btn-inline" type="button" id="searchName" value="Search" />
<input class="btn btn-inline" type="button" id="searchName" value="Search">
</span>
<br />
<br>
<p style="margin:5px 0 15px"><span class="add-tip">Enter show name, TVDB ID, IMDb Url, or IMDb ID.&nbsp;&nbsp;</span><b>*</b>SickGear supports english, language is used for show/episode data</p>
<div id="searchResults" style="height: 100%"></div>
@ -92,16 +101,17 @@
<div style="clear:both">&nbsp;</div>
</fieldset>
#if not $kwargs.get('action')
<fieldset class="sectionwrap step-two" style="visibility:hidden">
<legend class="legendStep"><p>Pick parent folder</p></legend>
<div class="stepDiv parent-folder">
#if $provided_show_dir
Pre-chosen Destination Folder: <b>$provided_show_dir</b> <br />
<input type="hidden" id="fullShowPath" name="fullShowPath" value="$provided_show_dir" /><br />
#else
#if $provided_show_dir
Pre-chosen Destination Folder: <b>$provided_show_dir</b> <br>
<input type="hidden" id="fullShowPath" name="fullShowPath" value="$provided_show_dir"><br>
#else
#include $os.path.join($sg_str('PROG_DIR'), 'gui/slick/interfaces/default/inc_rootDirs.tmpl')
#end if
#end if
</div>
<div style="clear:both">&nbsp;</div>
</fieldset>
@ -114,24 +124,30 @@
<div style="clear:both">&nbsp;</div>
</fieldset>
#for $curNextDir in $other_shows
<input type="hidden" name="other_shows" value="$curNextDir" />
#end for
<input type="hidden" name="skipShow" id="skipShow" value="" />
#for $curNextDir in $other_shows
<input type="hidden" name="other_shows" value="$curNextDir">
#end for
<input type="hidden" name="skipShow" id="skipShow" value="">
#end if
</form>
<br />
<br>
<div style="width: 100%; text-align: center;">
<input class="btn" type="button" id="addShowButton" value="Add Show" disabled="disabled" />
#if not $kwargs.get('action')
<input class="btn" type="button" id="addShowButton" value="Add Show" disabled="disabled">
#else
<input class="btn" type="button" id="addShowButton" value="Select Show" disabled="disabled">
<input class="btn btn-danger" type="button" id="cancelShowButton" value="Cancel Select" style="margin-left:10px" disabled="disabled">
#end if
#if $provided_show_dir
<input class="btn" type="button" id="skipShowButton" value="Skip Show" />
<input class="btn" type="button" id="skipShowButton" value="Skip Show">
#end if
</div>
<script type="text/javascript" src="$sbRoot/js/rootDirs.js?v=$sbPID"></script>
<script type="text/javascript" src="$sbRoot/js/blackwhite.js?v=$sbPID"></script>
</div></div>
</div>
#include $os.path.join($sg_str('PROG_DIR'), 'gui/slick/interfaces/default/inc_bottom.tmpl')

View file

@ -51,14 +51,14 @@
<h3>Search Queue:</h3>
#if $queueLength['backlog'] or $queueLength['manual'] or $queueLength['failed']
<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>
<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>
Recent: <i>$queueLength['recent'] item$sickbeard.helpers.maybe_plural($queueLength['recent'])</i></br></br>
Proper: <i>$queueLength['proper'] item$sickbeard.helpers.maybe_plural($queueLength['proper'])</i></br></br>
<br>
Recent: <i>$queueLength['recent'] item$sickbeard.helpers.maybe_plural($queueLength['recent'])</i><br><br>
Proper: <i>$queueLength['proper'] item$sickbeard.helpers.maybe_plural($queueLength['proper'])</i><br><br>
Backlog: <i>$len($queueLength['backlog']) item$sickbeard.helpers.maybe_plural($len($queueLength['backlog']))</i>
#if $queueLength['backlog']
<input type="button" class="shows-more btn" id="backlog-btn-more" value="Expand" #if not $queueLength['backlog']# style="display:none" #end if#><input type="button" class="shows-less btn" id="backlog-btn-less" value="Collapse" style="display:none"></br>
<input type="button" class="shows-more btn" id="backlog-btn-more" value="Expand" #if not $queueLength['backlog']# style="display:none" #end if#><input type="button" class="shows-less btn" id="backlog-btn-less" value="Collapse" style="display:none"><br>
<table class="sickbeardTable manageTable" cellspacing="1" border="0" cellpadding="0" style="display:none">
<thead></thead>
<tbody>
@ -90,12 +90,12 @@ Backlog: <i>$len($queueLength['backlog']) item$sickbeard.helpers.maybe_plural($l
</tbody>
</table>
#else
</br>
<br>
#end if
</br>
<br>
Manual: <i>$len($queueLength['manual']) item$sickbeard.helpers.maybe_plural($len($queueLength['manual']))</i>
#if $queueLength['manual']
<input type="button" class="shows-more btn" id="manual-btn-more" value="Expand" #if not $queueLength['manual']# style="display:none" #end if#><input type="button" class="shows-less btn" id="manual-btn-less" value="Collapse" style="display:none"></br>
<input type="button" class="shows-more btn" id="manual-btn-more" value="Expand" #if not $queueLength['manual']# style="display:none" #end if#><input type="button" class="shows-less btn" id="manual-btn-less" value="Collapse" style="display:none"><br>
<table class="sickbeardTable manageTable" cellspacing="1" border="0" cellpadding="0" style="display:none">
<thead></thead>
<tbody>
@ -110,12 +110,12 @@ Manual: <i>$len($queueLength['manual']) item$sickbeard.helpers.maybe_plural($len
</tbody>
</table>
#else
</br>
<br>
#end if
</br>
<br>
Failed: <i>$len($queueLength['failed']) item$sickbeard.helpers.maybe_plural($len($queueLength['failed']))</i>
#if $queueLength['failed']
<input type="button" class="shows-more btn" id="failed-btn-more" value="Expand" #if not $queueLength['failed']# style="display:none" #end if#><input type="button" class="shows-less btn" id="failed-btn-less" value="Collapse" style="display:none"></br>
<input type="button" class="shows-more btn" id="failed-btn-more" value="Expand" #if not $queueLength['failed']# style="display:none" #end if#><input type="button" class="shows-less btn" id="failed-btn-less" value="Collapse" style="display:none"><br>
<table class="sickbeardTable manageTable" cellspacing="1" border="0" cellpadding="0" style="display:none">
<thead></thead>
<tbody>
@ -130,7 +130,7 @@ Failed: <i>$len($queueLength['failed']) item$sickbeard.helpers.maybe_plural($len
</tbody>
</table>
#else
</br>
<br>
#end if
</div>
</div>

View file

@ -18,23 +18,23 @@
#end if
<div id="summary2" class="align-left">
<h3> Daily Show Update:</h3>
<h3> Daily show update:</h3>
<a id="showupdatebutton" class="btn#if $ShowUpdateRunning# disabled#end if#" href="$sbRoot/manage/showProcesses/forceShowUpdate"><i class="sgicon-play"></i> Force</a>
#if not $ShowUpdateRunning:
Not in progress<br />
#else:
Currently running<br />
#end if
</br>
<br>
#if $NotFoundShows
<h3>Shows not found previously:</h3>
<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>
<h3>Shows with abandoned master IDs:</h3>
<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 manageTable" cellspacing="1" border="0" cellpadding="0">
<thead></thead>
<tbody>
<tr>
<th>Show Name</th>
<th>Last Found</th>
<th style="text-align:left">Show name</th>
<th>Last found</th>
</tr>
#set $row = 0
#for $cur_show in $NotFoundShows:
@ -49,13 +49,13 @@
</table>
#end if
#if $DefunctIndexer
<h3>Shows from defunct indexers:</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>
<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></thead>
<tbody>
<tr>
<th>Show Name</th>
<th style="text-align:left">Show name</th>
</tr>
#set $row = 0
#for $cur_show in $DefunctIndexer:
@ -68,20 +68,20 @@
</tbody>
</table>
#end if
<h3>Show Queue:</h3>
</br>
<h3>Show queue:</h3>
<br>
#if $queueLength['add'] or $queueLength['update'] or $queueLength['refresh'] or $queueLength['rename'] or $queueLength['subtitle']
<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>
<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>
<br>
Add: <i>$len($queueLength['add']) show$sickbeard.helpers.maybe_plural($len($queueLength['add']))</i>
#if $queueLength['add']
<input type="button" class="shows-more btn" id="add-btn-more" value="Expand" #if not $queueLength['add']# style="display:none" #end if#><input type="button" class="shows-less btn" id="add-btn-less" value="Collapse" style="display:none"></br>
<input type="button" class="shows-more btn" id="add-btn-more" value="Expand" #if not $queueLength['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></thead>
<tbody>
<tr>
<th>Show Name</th>
<th>Show name</th>
<th></th>
</tr>
#set $row = 0
@ -95,18 +95,18 @@ Add: <i>$len($queueLength['add']) show$sickbeard.helpers.maybe_plural($len($queu
</tbody>
</table>
#else
</br>
<br>
#end if
</br>
<br>
Update <span class="grey-text">(Forced / Forced Web)</span>: <i>$len($queueLength['update']) <span class="grey-text">($len($queueLength['forceupdate']) / $len($queueLength['forceupdateweb']))</span> show$sickbeard.helpers.maybe_plural($len($queueLength['update']))</i>
#if $queueLength['update']
<input type="button" class="shows-more btn" id="update-btn-more" value="Expand" #if not $queueLength['update']# style="display:none" #end if#><input type="button" class="shows-less btn" id="update-btn-less" value="Collapse" style="display:none"></br>
<input type="button" class="shows-more btn" id="update-btn-more" value="Expand" #if not $queueLength['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></thead>
<tbody>
<tr>
<th>Show Name</th>
<th>Schedule Type</th>
<th>Show name</th>
<th>Schedule type</th>
</tr>
#set $row = 0
#for $cur_show in $queueLength['update']:
@ -122,18 +122,18 @@ Update <span class="grey-text">(Forced / Forced Web)</span>: <i>$len($queueLengt
</tbody>
</table>
#else
</br>
<br>
#end if
</br>
<br>
Refresh: <i>$len($queueLength['refresh']) show$sickbeard.helpers.maybe_plural($len($queueLength['refresh']))</i>
#if $queueLength['refresh']
<input type="button" class="shows-more btn" id="refresh-btn-more" value="Expand" #if not $queueLength['refresh']# style="display:none" #end if#><input type="button" class="shows-less btn" id="refresh-btn-less" value="Collapse" style="display:none"></br>
<input type="button" class="shows-more btn" id="refresh-btn-more" value="Expand" #if not $queueLength['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></thead>
<tbody>
<tr>
<th>Show Name</th>
<th>Schedule Type</th>
<th>Show name</th>
<th>Schedule type</th>
</tr>
#set $row = 0
#for $cur_show in $queueLength['refresh']:
@ -149,19 +149,19 @@ Refresh: <i>$len($queueLength['refresh']) show$sickbeard.helpers.maybe_plural($l
</tbody>
</table>
#else
</br>
<br>
#end if
</br>
<br>
Rename: <i>$len($queueLength['rename']) show$sickbeard.helpers.maybe_plural($len($queueLength['rename']))</i>
#if $queueLength['rename']
<input type="button" class="shows-more btn" id="rename-btn-more" value="Expand" #if not $queueLength['rename']# style="display:none" #end if#><input type="button" class="shows-less btn" id="rename-btn-less" value="Collapse" style="display:none"></br>
<input type="button" class="shows-more btn" id="rename-btn-more" value="Expand" #if not $queueLength['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></thead>
<tbody>
<tr>
<th>Show Name</th>
<th>Schedule Type</th>
<th>Show name</th>
<th>Schedule type</th>
</tr>
#set $row = 0
#for $cur_show in $queueLength['rename']:
@ -177,19 +177,19 @@ Rename: <i>$len($queueLength['rename']) show$sickbeard.helpers.maybe_plural($len
</tbody>
</table>
#else
</br>
<br>
#end if
#if $sickbeard.USE_SUBTITLES
</br>
<br>
Subtitle: <i>$len($queueLength['subtitle']) show$sickbeard.helpers.maybe_plural($len($queueLength['subtitle']))</i>
#if $queueLength['subtitle']
<input type="button" class="shows-more btn" id="subtitle-btn-more" value="Expand" #if not $queueLength['subtitle']# style="display:none" #end if#><input type="button" class="shows-less btn" id="subtitle-btn-less" value="Collapse" style="display:none"></br>
<input type="button" class="shows-more btn" id="subtitle-btn-more" value="Expand" #if not $queueLength['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></thead>
<tbody>
<tr>
<th>Show Name</th>
<th>Schedule Type</th>
<th>Show name</th>
<th>Schedule type</th>
</tr>
#set $row = 0
#for $cur_show in $queueLength['subtitle']:
@ -205,9 +205,9 @@ Rename: <i>$len($queueLength['rename']) show$sickbeard.helpers.maybe_plural($len
</tbody>
</table>
#else
</br>
<br>
#end if
#end if
</div>
</div>
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl')
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl')

View file

@ -1,6 +1,7 @@
/** @namespace $.SickGear.Root */
/** @namespace config.showLang */
/** @namespace config.showIsAnime */
/** @namespace config.expandIds */
/*globals $, config, sbRoot, generate_bwlist*/
$(document).ready(function () {
@ -67,7 +68,7 @@ $(document).ready(function () {
$('#SceneException').fadeIn('fast', 'linear');
var option = $('<option>');
if (null == sceneExSeason)
if (null === sceneExSeason)
sceneExSeason = '-1';
option.val(sceneExSeason + '|' + sceneEx);
option.html((config.showIsAnime ? 'S' + ('-1' === sceneExSeason ? '*' : sceneExSeason) + ': ' : '') + sceneEx);
@ -84,7 +85,7 @@ $(document).ready(function () {
$.fn.toggle_SceneException = function () {
var elSceneException = $('#SceneException');
if (0 == getExceptions().length)
if (0 === getExceptions().length)
elSceneException.fadeOut('fast', 'linear');
else
elSceneException.fadeIn('fast', 'linear');
@ -108,7 +109,7 @@ $(document).ready(function () {
if (checked(elAnime)) { isAnime(); }
if (checked(elScene)) { isScene(); }
if (checked(elABD)) { isABD(); }
if (checked(elSports)) { isSports() }
if (checked(elSports)) { isSports(); }
elAnime.on('click', function() {
if (checked(elAnime))
@ -127,6 +128,8 @@ $(document).ready(function () {
elABD.on('click', function() { isABD(); });
elSports.on('click', function() { isSports() });
if (config.expandIds) { elIdMap.click(); }
function undef(value) {
return /undefined/i.test(typeof(value));
}
@ -134,10 +137,10 @@ $(document).ready(function () {
function updateSrcLinks() {
var preventSave = !1, search = 'data-search';
$('[id^=mid-]').each(function (i, selected) {
$('[id^=mid-], #source-id').each(function (i, selected) {
var elSelected = $(selected),
okDigits = !(/[^\d]/.test(elSelected.val()) || ('' == elSelected.val())),
service = '#src-' + elSelected.attr('id'),
okDigits = !(/[^\d]/.test(elSelected.val()) || ('' === elSelected.val())),
service = (('source-id' === elSelected.attr('id')) ? '#src-' + elSelected.attr('name') : '#src-' + elSelected.attr('id')),
elLock = $('#lockid-' + service.replace(/.*?(\d+)$/, '$1')),
elService = $(service),
On = 'data-', Off = '', linkOnly = !1, newLink = '';
@ -150,14 +153,14 @@ $(document).ready(function () {
}
}
$.each(['href', 'title', 'onclick'], function(i, attr) {
if ('n' == elService.attr(search)) {
if ('n' === elService.attr(search)) {
elService.attr(On + attr, elService.attr(Off + attr)).removeAttr(Off + attr);
}
if (linkOnly)
elService.attr(attr, elService.attr(search + '-' + attr));
elService.attr(search, linkOnly ? 'y' : 'n')
});
if (('' == Off) && !linkOnly) {
if (('' === Off) && !linkOnly) {
preventSave = !0;
elSelected.addClass('warning').attr({title: 'Use digits (0-9)'});
elLock.prop('disabled', !0);
@ -178,14 +181,14 @@ $(document).ready(function () {
$('#save-mapping').prop('disabled', preventSave);
}
$('[id^=mid-]').on('input', function() {
$('[id^=mid-], #source-id').on('input', function() {
updateSrcLinks();
});
function saveMapping(paused, markWanted) {
var sbutton = $(this), mid = $('[id^=mid-]'), lock = $('[id^=lockid-]'),
allf = $('[id^=mid-], [id^=lockid-], #reset-mapping, [name^=set-master]'),
radio = $('[name^=set-master]:checked'), isMaster = !radio.length || 'the-master' == radio.attr('id'),
radio = $('[name^=set-master]:checked'), isMaster = !radio.length || ('the-master' === radio.attr('id') && $.trim($('#source-id').val()) == $('#show').val()),
panelSaveGet = $('#panel-save-get'), saveWait = $('#save-wait');
allf.prop('disabled', !0);
@ -197,10 +200,10 @@ $(document).ready(function () {
lock.each(function (i, selected) {
param[$(selected).attr('id')] = $(selected).prop('checked');
});
param['indexer'] = $('#indexer').val();
if (!isMaster) {
param['indexer'] = $('#indexer').val();
param['mindexer'] = radio.attr('data-indexer');
param['mindexerid'] = radio.attr('data-indexerid');
param['mindexerid'] = $.trim(radio.closest('span').find('input:text').val());
param['paused'] = paused ? '1' : '0';
param['markwanted'] = markWanted ? '1' : '0';
panelSaveGet.removeClass('show').addClass('hide');
@ -216,19 +219,19 @@ $(document).ready(function () {
if (undef(data.error)) {
$.each(data.map, function (i, item) {
$('#mid-' + i).val(item.id);
$('#lockid-' + i).prop('checked', -100 == item.status)
$('#lockid-' + i).prop('checked', -100 === item.status)
});
/** @namespace data.switch */
/** @namespace data.switch.mid */
if (!isMaster && data.hasOwnProperty('switch') && data.switch.hasOwnProperty('Success')) {
window.location.replace(sbRoot + '/home/displayShow?show=' + data.mid);
} else if ((0 < $('*[data-maybe-master=1]').length)
&& (((0 == $('[name^=set-master]').length) && (0 < $('*[data-maybe-master=1]').val()))
|| ((0 < $('[name^=set-master]').length) && (0 == $('*[data-maybe-master=1]').val())))) {
&& (((0 === $('[name^=set-master]').length) && (0 < $('*[data-maybe-master=1]').val()))
|| ((0 < $('[name^=set-master]').length) && (0 === $('*[data-maybe-master=1]').val())))) {
location.reload();
}
}})
.fail(function (data) {
.fail(function () {
allf.prop('disabled', !1);
sbutton.prop('disabled', !1);
});
@ -258,22 +261,21 @@ $(document).ready(function () {
$('#the-master').prop('checked', !0).trigger('click');
$.each(data, function (i, item) {
$('#mid-' + i).val(item.id);
$('#lockid-' + i).prop('checked', -100 == item.status);
$('#lockid-' + i).prop('checked', -100 === item.status);
});
updateSrcLinks();
}})
.fail(function (data) {
.fail(function () {
allf.prop('disabled', !1);
fbutton.prop('disabled', !1);
});
}
$('#save-mapping, #reset-mapping').click(function() {
var save = /save/i.test($(this).attr('id')),
radio = $('[name=set-master]:checked'), isMaster = !radio.length || 'the-master' == radio.attr('id'),
var save = /save/i.test(this.id),
radio = $('[name=set-master]:checked'), isMaster = !radio.length || ('the-master' === radio.attr('id') && $.trim($('#source-id').val()) == $('#show').val()),
newMaster = (save && !isMaster),
paused = 'on' == $('#paused:checked').val(),
paused = 'on' === $('#paused:checked').val(),
extraWarn = !newMaster ? '' : 'Warning: Changing the master source can produce undesirable'
+ ' results if episodes do not match at old and new TV info sources<br /><br />'
+ (paused ? '' : '<input type="checkbox" id="mark-wanted" style="margin-right:6px">'
@ -288,7 +290,7 @@ $(document).ready(function () {
'Yes': {
'class': 'green',
'action': function () {
save ? saveMapping(paused, 'on' == $('#mark-wanted:checked').val()) : resetMapping()
save ? saveMapping(paused, 'on' === $('#mark-wanted:checked').val()) : resetMapping()
}
},
'No': {

View file

@ -53,11 +53,13 @@ $(document).ready(function () {
searchRequestXhr.abort();
var elTvDatabase = $('#providedIndexer'),
elIndexerLang = $('#indexerLangSelect');
elIndexerLang = $('#indexerLangSelect'),
tvsrcName = elTvDatabase.find('option:selected').text(),
tvSearchSrc = 0 < tvsrcName.length ? ' on ' + tvsrcName : '';
$('#searchResults').empty().html('<img id="searchingAnim" src="' + sbRoot + '/images/loading32' + themeSpinner + '.gif" height="32" width="32" />'
+ ' searching <span class="boldest">' + cleanseText(elNameToSearch.val(), !0) + '</span>'
+ ' on ' + elTvDatabase.find('option:selected').text() + ' in ' + elIndexerLang.val()
+ tvSearchSrc + ' in ' + elIndexerLang.val()
+ '...');
searchRequestXhr = $.ajax({
@ -122,7 +124,7 @@ $(document).ready(function () {
+ '<span style=\'float:right;clear:both\'>Click for more</span>'
+ '"'
+ ' href="' + anonURL + item[result.SrcUrl] + item[result.ShowID] + ((data.langid && '' != data.langid) ? '&lid=' + data.langid : '') + '"'
+ ' onclick="window.open(this.href, \'_blank\'); return false;"'
+ ' onclick="window.open(this.href, \'_blank\'); return !1;"'
+ '>' + (config.sortArticle ? displayShowName : displayShowName.replace(/^((?:A(?!\s+to)n?)|The)(\s)+(.*)/i, '$3$2<span class="article">($1)</span>')) + '</a>'
+ showstartdate
+ ('' === srcState ? ''
@ -229,14 +231,18 @@ $(document).ready(function () {
elSearchName.click();
}
$('#addShowButton').click(function () {
// if they haven't picked a show don't let them submit
if (!$('input:radio[name="whichSeries"]:checked').val()
&& !$('input:hidden[name="whichSeries"]').val().length) {
alert('You must choose a show to continue');
return false;
$('#addShowButton, #cancelShowButton').click(function () {
if (/cancel/.test(this.id)){
$('input[name=cancel_form]').val('1');
} else {
// if they haven't picked a show don't let them submit
if (!$('input:radio[name="whichSeries"]:checked').val()
&& !$('input:hidden[name="whichSeries"]').val().length) {
alert('You must choose a show to continue');
return !1;
}
generate_bwlist();
}
generate_bwlist();
$('#addShowForm').submit();
});
@ -279,6 +285,11 @@ $(document).ready(function () {
elNameToSearch.focus();
function updateSampleText() {
if (0 === $('#displayText').length) {
$('#cancelShowButton').attr('disabled', !1);
$('#addShowButton').attr('disabled', 0 === $('#holder').find('.results-item').length);
return;
}
// if something's selected then we have some behavior to figure out
var show_name = '',
@ -343,9 +354,9 @@ $(document).ready(function () {
// also toggle the add show button
if ((elRootDirs.find('option:selected').length || (elFullShowPath.length && elFullShowPath.val().length)) &&
(elRadio.length) || (elInput.length && elInput.val().length)) {
$('#addShowButton').attr('disabled', false);
$('#addShowButton').attr('disabled', !1);
} else {
$('#addShowButton').attr('disabled', true);
$('#addShowButton').attr('disabled', !0);
}
}
@ -363,7 +374,7 @@ $(document).ready(function () {
$(this).css('cursor', 'help');
$(this).qtip({
show: {
solo: true
solo: !0
},
position: {
viewport: $(window),
@ -375,7 +386,7 @@ $(document).ready(function () {
},
style: {
tip: {
corner: true,
corner: !0,
method: 'polygon'
},
classes: 'qtip-rounded qtip-bootstrap qtip-shadow ui-tooltip-sb'

View file

@ -109,10 +109,11 @@ $(document).ready(function() {
function setDefault(which, force){
console.log('setting default to '+which);
//console.log('setting default to '+which);
if (which != undefined && !which.length)
return
if (/undefined/i.test(which) || !which.length) {
return;
}
if ($('#whichDefaultRootDir').val() == which && force != true)
return
@ -186,4 +187,4 @@ $(document).ready(function() {
setDefault($('#whichDefaultRootDir').val(), true)
refreshRootDirs();
});
});

View file

@ -1319,11 +1319,14 @@ class Home(MainHandler):
elif sickbeard.showQueueScheduler.action.isInSubtitleQueue(showObj): # @UndefinedVariable
show_message = 'This show is queued and awaiting subtitles download.'
if showObj.not_found_count > 0:
# noinspection PyUnresolvedReferences
last_found = ('never', sbdatetime.sbdatetime.fromordinal(showObj.last_found_on_indexer).sbfdate())[showObj.last_found_on_indexer > 1]
show_message = 'This show was not found (last time found: %s) on the Source Indexer%s' % (last_found, ('', '<br>%s' % show_message)[len(show_message) > 0])
if 0 < showObj.not_found_count:
last_found = ('', ' since %s' % sbdatetime.sbdatetime.fromordinal(
showObj.last_found_on_indexer).sbfdate())[1 < showObj.last_found_on_indexer]
show_message = (
'The master ID of this show has been abandoned%s, ' % last_found
+ '<a href="%s/home/editShow?show=%s&tvsrc=0&srcid=%s#core-component-group3">replace it here</a>' % (
sickbeard.WEB_ROOT, show, show)
+ ('', '<br>%s' % show_message)[0 < len(show_message)])
t.force_update = 'home/updateShow?show=%d&amp;force=1&amp;web=1' % showObj.indexerid
if not sickbeard.showQueueScheduler.action.isBeingAdded(showObj): # @UndefinedVariable
if not sickbeard.showQueueScheduler.action.isBeingUpdated(showObj): # @UndefinedVariable
@ -1749,6 +1752,10 @@ class Home(MainHandler):
t = PageTemplate(headers=self.request.headers, file='editShow.tmpl')
t.submenu = self.HomeMenu()
t.expand_ids = all([kwargs.get('tvsrc'), kwargs.get('srcid')])
t.tvsrc = int(kwargs.get('tvsrc', 0))
t.srcid = kwargs.get('srcid')
myDB = db.DBConnection()
t.seasonResults = myDB.select(
'SELECT DISTINCT season FROM tv_episodes WHERE showid = ? ORDER BY season asc', [showObj.indexerid])
@ -1777,14 +1784,17 @@ class Home(MainHandler):
self.fanart_tmpl(t)
t.num_ratings = len(sickbeard.FANART_RATINGS.get(str(t.show.indexerid), {}))
t.unlock_master_id = 0 < showObj.not_found_count
t.showname_enc = urllib.quote_plus(showObj.name.encode('utf-8'))
show_message = ''
if showObj.not_found_count > 0:
if 0 < showObj.not_found_count:
# noinspection PyUnresolvedReferences
last_found = ('never', sbdatetime.sbdatetime.fromordinal(showObj.last_found_on_indexer).sbfdate())[
showObj.last_found_on_indexer > 1]
show_message = 'This show was not found (last time found: %s) on the Source Indexer' % last_found
last_found = ('', ' since %s' % sbdatetime.sbdatetime.fromordinal(
showObj.last_found_on_indexer).sbfdate())[1 < showObj.last_found_on_indexer]
show_message = 'The master ID of this show has been abandoned%s<br>search for ' % last_found + \
'a replacement in the "<b>Related show IDs</b>" section of the "<b>Other</b>" tab'
t.show_message = show_message
@ -3625,11 +3635,18 @@ class NewHomeAddShows(Home):
def addNewShow(self, whichSeries=None, indexerLang='en', rootDir=None, defaultStatus=None,
quality_preset=None, anyQualities=None, bestQualities=None, flatten_folders=None, subtitles=None,
fullShowPath=None, other_shows=None, skipShow=None, providedIndexer=None, anime=None,
scene=None, blacklist=None, whitelist=None, wanted_begin=None, wanted_latest=None, tag=None):
scene=None, blacklist=None, whitelist=None, wanted_begin=None, wanted_latest=None, tag=None,
return_to=None, cancel_form=None):
"""
Receive tvdb id, dir, and other options and create a show from them. If extra show dirs are
provided then it forwards back to new_show, if not it goes to /home.
"""
if None is not return_to:
indexer, void, indexer_id, show_name = self.split_extra_show(whichSeries)
if bool(helpers.tryInt(cancel_form)):
indexer = indexer or providedIndexer or '1'
indexer_id = re.findall('show=([\d]+)', return_to)[0]
return self.redirect(return_to % (indexer, indexer_id))
# grab our list of other dirs if given
if not other_shows: