Merge pull request #227 from JackDandy/feature/AddExplainExtraPPScripts

Add text to explain params passed to extra scripts on Config/Post Proces...
This commit is contained in:
JackDandy 2015-02-23 16:54:32 +00:00
commit bbdec53dcd
3 changed files with 538 additions and 505 deletions

View file

@ -3,6 +3,7 @@
* Add requirements file for pip (port from midgetspy/sick-beard) * Add requirements file for pip (port from midgetspy/sick-beard)
* Remove unused libraries fuzzywuzzy and pysrt * Remove unused libraries fuzzywuzzy and pysrt
* Change webserve code to a logical layout and PEP8 * Change webserve code to a logical layout and PEP8
* Add text to explain params passed to extra scripts on Config/Post Processing
[develop changelog] [develop changelog]

View file

@ -53,7 +53,7 @@
<div class="red-text"><em class="boldest">must not</em> be the folder where downloading files are created</div> <div class="red-text"><em class="boldest">must not</em> be the folder where downloading files are created</div>
</span> </span>
<span class="component-desc"> <span class="component-desc">
<input type="text" name="tv_download_dir" id="tv_download_dir" value="$sickbeard.TV_DOWNLOAD_DIR" class="form-control input-sm input350" /> <input type="text" name="tv_download_dir" id="tv_download_dir" value="$sickbeard.TV_DOWNLOAD_DIR" class="form-control input-sm input350">
<div class="pull-left"> <div class="pull-left">
<p>folder where download clients save <b><em class="boldest">completed</em></b> downloads.&nbsp; <p>folder where download clients save <b><em class="boldest">completed</em></b> downloads.&nbsp;
<b>note:</b> only use if not using SABnzbd post processing <em>or</em> if SABnzbd is on a different PC to SickGear</p> <b>note:</b> only use if not using SABnzbd post processing <em>or</em> if SABnzbd is on a different PC to SickGear</p>
@ -86,7 +86,7 @@
<label for="process_automatically"> <label for="process_automatically">
<span class="component-title">Scan and post process</span> <span class="component-title">Scan and post process</span>
<span class="component-desc"> <span class="component-desc">
<input type="checkbox" name="process_automatically" id="process_automatically" #if $sickbeard.PROCESS_AUTOMATICALLY == True then $checked else ''# /> <input type="checkbox" name="process_automatically" id="process_automatically" #if $sickbeard.PROCESS_AUTOMATICALLY == True then $checked else ''#>
<p>files in the <em>completed TV downloads</em> folder.&nbsp; <p>files in the <em>completed TV downloads</em> folder.&nbsp;
<b>note:</b> do not enable with external post processing scripts like sabToSickbeard for SABnzbd, or NZBMedia for NZBGET</p> <b>note:</b> do not enable with external post processing scripts like sabToSickbeard for SABnzbd, or NZBMedia for NZBGET</p>
</span> </span>
@ -97,7 +97,7 @@
<label for="autopostprocesser_frequency"> <label for="autopostprocesser_frequency">
<span class="component-title">Run post process every</span> <span class="component-title">Run post process every</span>
<span class="component-desc"> <span class="component-desc">
<input type="text" name="autopostprocesser_frequency" id="autopostprocesser_frequency" value="$sickbeard.AUTOPOSTPROCESSER_FREQUENCY" class="form-control input-sm input75" /> <input type="text" name="autopostprocesser_frequency" id="autopostprocesser_frequency" value="$sickbeard.AUTOPOSTPROCESSER_FREQUENCY" class="form-control input-sm input75">
<p>minutes to check for new files to process (e.g. 10)</p> <p>minutes to check for new files to process (e.g. 10)</p>
</span> </span>
</label> </label>
@ -107,8 +107,8 @@
<label for="postpone_if_sync_files"> <label for="postpone_if_sync_files">
<span class="component-title">Postpone post processing</span> <span class="component-title">Postpone post processing</span>
<span class="component-desc"> <span class="component-desc">
<input type="checkbox" name="postpone_if_sync_files" id="postpone_if_sync_files" #if $sickbeard.POSTPONE_IF_SYNC_FILES == True then $checked else ''# /> <input type="checkbox" name="postpone_if_sync_files" id="postpone_if_sync_files" #if $sickbeard.POSTPONE_IF_SYNC_FILES == True then $checked else ''#>
<p>if <b>!sync</b> files are present in the <em>completed TV downloads</em> folder</p> <p>if <b class="grey-text">!sync</b> files are present in the <em>completed TV downloads</em> folder</p>
</span> </span>
</label> </label>
</div> </div>
@ -117,17 +117,46 @@
<label for="extra_scripts"> <label for="extra_scripts">
<span class="component-title">Extra scripts</span> <span class="component-title">Extra scripts</span>
<span class="component-desc"> <span class="component-desc">
<input type="text" name="extra_scripts" value="<%='|'.join(sickbeard.EXTRA_SCRIPTS)%>" class="form-control input-sm input350" /> <input type="text" name="extra_scripts" id="extra_scripts" value="<%='|'.join(sickbeard.EXTRA_SCRIPTS)%>" class="form-control input-sm input350">
<img src="$sbRoot/images/legend16.png" width="16" height="16" alt="[Toggle Key]" id="show_extra_params" title="Toggle info for script arguments" class="legend" class="legend" />
<div class="clear-left"> <div class="clear-left">
<p>scripts are called after SickGear's built-in post processing. <p>scripts are called after built-in post processing.
&nbsp;<b>note:</b> use <b>|</b> to separate additional extra scripts</span> &nbsp;<b>note:</b> use <b class="grey-text boldest">|</b> to separate additional extra scripts
</p> (e.g. <span class="grey-text">inside_SG_root_folder.sh|/other/path/to/script.py</span>)</p>
<div id="extra_params" style="display: none">
<table class="Key" style="width:auto">
<thead>
<tr>
<th class="text-center">Arg</th>
<th>Description</th>
<th style="width:5%"></th>
<th class="text-center">Arg</th>
<th>Description</th>
</tr>
</thead>
<tfoot>
<tr>
<th colspan="5">These arguments are passed to every script</th>
</tr>
</tfoot>
<tbody>
<tr><td class="text-center"><span class="grey-text">1</span></td><td>final full episode file path</td>
<td>&nbsp;</td><td class="text-center"><span class="grey-text">4</span></td><td>season number</td></tr>
<tr class="even"><td class="text-center"><span class="grey-text">2</span></td><td>original episode file name</td>
<td>&nbsp;</td><td class="text-center"><span class="grey-text">5</span></td><td style="padding-right:1.5em !important">episode number</td></tr>
<tr><td class="text-center"><span class="grey-text">3</span></td><td>show id</td>
<td>&nbsp;</td><td class="text-center"><span class="grey-text">6</span></td><td>episode air date</td></tr>
</tbody>
</table>
</div>
</div> </div>
</span> </span>
</label> </label>
</div> </div>
<input type="submit" class="btn config_submitter" value="Save Changes" /><br/> <input type="submit" class="btn config_submitter" value="Save Changes"><br />
</fieldset> </fieldset>
</div> </div>
@ -145,7 +174,7 @@
<label for="unpack"> <label for="unpack">
<span class="component-title">Unpack downloads</span> <span class="component-title">Unpack downloads</span>
<span class="component-desc"> <span class="component-desc">
<input id="unpack" type="checkbox" name="unpack" #if $sickbeard.UNPACK == True then $checked else ''# /> <input id="unpack" type="checkbox" name="unpack" #if $sickbeard.UNPACK == True then $checked else ''#>
<p>unrar TV releases in the <em>completed TV downloads</em> folder</p> <p>unrar TV releases in the <em>completed TV downloads</em> folder</p>
</span> </span>
</label> </label>
@ -155,8 +184,8 @@
<label for="skip_removed_files"> <label for="skip_removed_files">
<span class="component-title">Skip remove detection</span> <span class="component-title">Skip remove detection</span>
<span class="component-desc"> <span class="component-desc">
<input type="checkbox" name="skip_removed_files" id="skip_removed_files" #if $sickbeard.SKIP_REMOVED_FILES == True then $checked else ''# /> <input type="checkbox" name="skip_removed_files" id="skip_removed_files" #if $sickbeard.SKIP_REMOVED_FILES == True then $checked else ''#>
<p>skip detection of removed files so the episode is not set to ignored<br> <p>skip detection of removed files so the episode is not set to ignored<br />
<b>note:</b> this may mean SickGear misses renames as well</p> <b>note:</b> this may mean SickGear misses renames as well</p>
</span> </span>
</label> </label>
@ -166,7 +195,7 @@
<label for="move_associated_files"> <label for="move_associated_files">
<span class="component-title">Move associated files</span> <span class="component-title">Move associated files</span>
<span class="component-desc"> <span class="component-desc">
<input type="checkbox" name="move_associated_files" id="move_associated_files" #if $sickbeard.MOVE_ASSOCIATED_FILES == True then $checked else ''# /> <input type="checkbox" name="move_associated_files" id="move_associated_files" #if $sickbeard.MOVE_ASSOCIATED_FILES == True then $checked else ''#>
<p>move srr/srt/sfv/etc files with the episode when processed</p> <p>move srr/srt/sfv/etc files with the episode when processed</p>
</span> </span>
</label> </label>
@ -176,7 +205,7 @@
<label for="nfo_rename"> <label for="nfo_rename">
<span class="component-title">Rename .nfo file</span> <span class="component-title">Rename .nfo file</span>
<span class="component-desc"> <span class="component-desc">
<input type="checkbox" name="nfo_rename" id="nfo_rename" #if $sickbeard.NFO_RENAME == True then $checked else ''# /> <input type="checkbox" name="nfo_rename" id="nfo_rename" #if $sickbeard.NFO_RENAME == True then $checked else ''#>
<p>rename the original .nfo file to .nfo-orig to avoid conflicts</p> <p>rename the original .nfo file to .nfo-orig to avoid conflicts</p>
</span> </span>
</label> </label>
@ -186,7 +215,7 @@
<label for="rename_episodes"> <label for="rename_episodes">
<span class="component-title">Rename episodes</span> <span class="component-title">Rename episodes</span>
<span class="component-desc"> <span class="component-desc">
<input type="checkbox" name="rename_episodes" id="rename_episodes" #if $sickbeard.RENAME_EPISODES == True then $checked else ''# /> <input type="checkbox" name="rename_episodes" id="rename_episodes" #if $sickbeard.RENAME_EPISODES == True then $checked else ''#>
<p>rename episodes using the Episode Naming settings</p> <p>rename episodes using the Episode Naming settings</p>
</span> </span>
</label> </label>
@ -196,14 +225,14 @@
<label for="airdate_episodes"> <label for="airdate_episodes">
<span class="component-title">Change file date</span> <span class="component-title">Change file date</span>
<span class="component-desc"> <span class="component-desc">
<input type="checkbox" name="airdate_episodes" id="airdate_episodes" #if $sickbeard.AIRDATE_EPISODES == True then $checked else ''# /> <input type="checkbox" name="airdate_episodes" id="airdate_episodes" #if $sickbeard.AIRDATE_EPISODES == True then $checked else ''#>
<p>set last modified filedate to the date that the episode aired<br> <p>set last modified filedate to the date that the episode aired<br />
<b>note:</b> some systems may ignore this feature.</p> <b>note:</b> some systems may ignore this feature.</p>
</span> </span>
</label> </label>
</div> </div>
<input type="submit" class="btn config_submitter" value="Save Changes" /><br/> <input type="submit" class="btn config_submitter" value="Save Changes"><br />
</fieldset> </fieldset>
</div> </div>
@ -221,7 +250,7 @@
<label for="use_failed_downloads" style="margin-bottom:0"> <label for="use_failed_downloads" style="margin-bottom:0">
<span class="component-title">Enable</span> <span class="component-title">Enable</span>
<span class="component-desc"> <span class="component-desc">
<input id="use_failed_downloads" type="checkbox" class="enabler" name="use_failed_downloads" #if $sickbeard.USE_FAILED_DOWNLOADS == True then $checked else ''# /> <input id="use_failed_downloads" type="checkbox" class="enabler" name="use_failed_downloads" #if $sickbeard.USE_FAILED_DOWNLOADS == True then $checked else ''#>
<p>failed download handling</p> <p>failed download handling</p>
</span> </span>
</label> </label>
@ -243,14 +272,14 @@
<label for="delete_failed"> <label for="delete_failed">
<span class="component-title">Delete failed downloads</span> <span class="component-title">Delete failed downloads</span>
<span class="component-desc"> <span class="component-desc">
<input id="delete_failed" type="checkbox" name="delete_failed" #if $sickbeard.DELETE_FAILED == True then $checked else ''# /> <input id="delete_failed" type="checkbox" name="delete_failed" #if $sickbeard.DELETE_FAILED == True then $checked else ''#>
<p>delete left over files from a failed download<br> <p>delete left over files from a failed download<br />
</span> </span>
</label> </label>
</div> </div>
</div> </div>
<input type="submit" class="btn config_submitter" value="Save Changes" /><br/> <input type="submit" class="btn config_submitter" value="Save Changes"><br />
</fieldset> </fieldset>
</div> </div>
@ -300,7 +329,7 @@
<label for="naming_pattern"> <label for="naming_pattern">
<span class="component-title"></span> <span class="component-title"></span>
<span class="component-desc"> <span class="component-desc">
<input type="text" name="naming_pattern" id="naming_pattern" value="$sickbeard.NAMING_PATTERN" class="form-control input-sm input350 custom-pattern" /> <input type="text" name="naming_pattern" id="naming_pattern" value="$sickbeard.NAMING_PATTERN" class="form-control input-sm input350 custom-pattern">
<img src="$sbRoot/images/legend16.png" width="16" height="16" alt="[Toggle Key]" id="show_naming_key" title="Toggle Naming Legend" class="legend" class="legend" /> <img src="$sbRoot/images/legend16.png" width="16" height="16" alt="[Toggle Key]" id="show_naming_key" title="Toggle Naming Legend" class="legend" class="legend" />
</span> </span>
</label> </label>
@ -423,7 +452,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<br/> <br />
</div> </div>
</div> </div>
@ -461,7 +490,7 @@
<div class="example"> <div class="example">
<span class="jumbo" id="naming_example">&nbsp;</span> <span class="jumbo" id="naming_example">&nbsp;</span>
</div> </div>
<br/> <br />
</div> </div>
<div id="naming_example_multi_div"> <div id="naming_example_multi_div">
@ -471,7 +500,7 @@
<div class="example"> <div class="example">
<span class="jumbo" id="naming_example_multi">&nbsp;</span> <span class="jumbo" id="naming_example_multi">&nbsp;</span>
</div> </div>
<br/> <br />
</div> </div>
</fieldset> </fieldset>
@ -520,7 +549,7 @@
<label for="naming_abd_pattern"> <label for="naming_abd_pattern">
<span class="component-title"></span> <span class="component-title"></span>
<span class="component-desc"> <span class="component-desc">
<input type="text" name="naming_abd_pattern" id="naming_abd_pattern" value="$sickbeard.NAMING_ABD_PATTERN" class="form-control input-sm input350 custom-pattern" /> <input type="text" name="naming_abd_pattern" id="naming_abd_pattern" value="$sickbeard.NAMING_ABD_PATTERN" class="form-control input-sm input350 custom-pattern">
<img src="$sbRoot/images/legend16.png" width="16" height="16" alt="[Toggle Key]" id="show_naming_abd_key" title="Toggle ABD Naming Legend" class="legend" /> <img src="$sbRoot/images/legend16.png" width="16" height="16" alt="[Toggle Key]" id="show_naming_abd_key" title="Toggle ABD Naming Legend" class="legend" />
</span> </span>
</label> </label>
@ -648,7 +677,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<br/> <br />
</div> </div>
</div><!-- /naming_abd_custom --> </div><!-- /naming_abd_custom -->
</div> </div>
@ -663,13 +692,13 @@
<div class="example"> <div class="example">
<span class="jumbo" id="naming_abd_example">&nbsp;</span> <span class="jumbo" id="naming_abd_example">&nbsp;</span>
</div> </div>
<br/> <br />
</div> </div>
</div> </div>
</fieldset> </fieldset>
<div class="field-pair right"> <div class="field-pair right">
<input type="submit" class="btn config_submitter" value="Save Changes" /><br/> <input type="submit" class="btn config_submitter" value="Save Changes"><br />
</div> </div>
</div><!-- /naming_abd_different --> </div><!-- /naming_abd_different -->
@ -718,7 +747,7 @@
<label for="naming_sports_pattern"> <label for="naming_sports_pattern">
<span class="component-title"></span> <span class="component-title"></span>
<span class="component-desc"> <span class="component-desc">
<input type="text" name="naming_sports_pattern" id="naming_sports_pattern" value="$sickbeard.NAMING_SPORTS_PATTERN" class="form-control input-sm input350 custom-pattern" /> <input type="text" name="naming_sports_pattern" id="naming_sports_pattern" value="$sickbeard.NAMING_SPORTS_PATTERN" class="form-control input-sm input350 custom-pattern">
<img src="$sbRoot/images/legend16.png" width="16" height="16" alt="[Toggle Key]" id="show_naming_sports_key" title="Toggle Sports Naming Legend" class="legend" /> <img src="$sbRoot/images/legend16.png" width="16" height="16" alt="[Toggle Key]" id="show_naming_sports_key" title="Toggle Sports Naming Legend" class="legend" />
</span> </span>
</label> </label>
@ -846,7 +875,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<br/> <br />
</div> </div>
</div><!-- /naming_sports_custom --> </div><!-- /naming_sports_custom -->
</div> </div>
@ -863,7 +892,7 @@
<div class="example"> <div class="example">
<span class="jumbo" id="naming_sports_example">&nbsp;</span> <span class="jumbo" id="naming_sports_example">&nbsp;</span>
</div> </div>
<br/> <br />
</div> </div>
</div> </div>
@ -871,7 +900,7 @@
</fieldset> </fieldset>
<div class="field-pair right"> <div class="field-pair right">
<input type="submit" class="btn config_submitter" value="Save Changes" /><br/> <input type="submit" class="btn config_submitter" value="Save Changes"><br />
</div> </div>
</div><!-- /naming_sports_different --> </div><!-- /naming_sports_different -->
@ -921,7 +950,7 @@
<label for="naming_anime_pattern"> <label for="naming_anime_pattern">
<span class="component-title"></span> <span class="component-title"></span>
<span class="component-desc"> <span class="component-desc">
<input type="text" name="naming_anime_pattern" id="naming_anime_pattern" value="$sickbeard.NAMING_ANIME_PATTERN" class="form-control input-sm input350 custom-pattern" /> <input type="text" name="naming_anime_pattern" id="naming_anime_pattern" value="$sickbeard.NAMING_ANIME_PATTERN" class="form-control input-sm input350 custom-pattern">
<img src="$sbRoot/images/legend16.png" width="16" height="16" alt="[Toggle Key]" id="show_naming_anime_key" title="Toggle Anime Naming Legend" class="legend" /> <img src="$sbRoot/images/legend16.png" width="16" height="16" alt="[Toggle Key]" id="show_naming_anime_key" title="Toggle Anime Naming Legend" class="legend" />
</span> </span>
</label> </label>
@ -1044,7 +1073,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<br/> <br />
</div> </div>
</div><!-- /naming_anime_custom --> </div><!-- /naming_anime_custom -->
@ -1074,7 +1103,7 @@
<div class="example"> <div class="example">
<span class="jumbo" id="naming_example_anime">&nbsp;</span> <span class="jumbo" id="naming_example_anime">&nbsp;</span>
</div> </div>
<br/> <br />
</div> </div>
<div id="naming_example_multi_anime_div"> <div id="naming_example_multi_anime_div">
@ -1084,7 +1113,7 @@
<div class="example"> <div class="example">
<span class="jumbo" id="naming_example_multi_anime">&nbsp;</span> <span class="jumbo" id="naming_example_multi_anime">&nbsp;</span>
</div> </div>
<br/> <br />
</div> </div>
</fieldset> </fieldset>
@ -1096,7 +1125,7 @@
<span class="component-title">Add absolute numbering</span> <span class="component-title">Add absolute numbering</span>
<span class="component-desc"> <span class="component-desc">
<input type="radio" name="naming_anime" id="naming_anime" value="1" #if $sickbeard.NAMING_ANIME == 1 then $checked else ''#/> <input type="radio" name="naming_anime" id="naming_anime" value="1" #if $sickbeard.NAMING_ANIME == 1 then $checked else ''#/>
<p>add the absolute number to the season/episode format<br> <p>add the absolute number to the season/episode format<br />
(eg. S15E45 - 310 vs S15E45)</p> (eg. S15E45 - 310 vs S15E45)</p>
</span> </span>
</label> </label>
@ -1125,7 +1154,7 @@
</fieldset> </fieldset>
<div class="field-pair right"> <div class="field-pair right">
<input type="submit" class="btn config_submitter" value="Save Changes" /><br/> <input type="submit" class="btn config_submitter" value="Save Changes"><br />
</div> </div>
</div><!-- /naming_anime_different --> </div><!-- /naming_anime_different -->
@ -1202,18 +1231,18 @@
<label for="${cur_id}_season_all_banner"><span id="${cur_id}_eg_season_all_banner">$cur_metadata_inst.eg_season_all_banner</span></label> <label for="${cur_id}_season_all_banner"><span id="${cur_id}_eg_season_all_banner">$cur_metadata_inst.eg_season_all_banner</span></label>
</div> </div>
</div> </div>
<input type="hidden" name="${cur_id}_data" id="${cur_id}_data" value="$cur_metadata_inst.get_config()" /> <input type="hidden" name="${cur_id}_data" id="${cur_id}_data" value="$cur_metadata_inst.get_config()">
</div> </div>
#end for #end for
<div class="clearfix"></div><br/> <div class="clearfix"></div><br />
<input type="submit" class="btn config_submitter" value="Save Changes" /><br/> <input type="submit" class="btn config_submitter" value="Save Changes"><br />
</fieldset> </fieldset>
</div><!-- /component-group3 //--> </div><!-- /component-group3 //-->
<br/> <br />
<h6 class="pull-right"><b>All non-absolute folder locations are relative to <span class="path">$sickbeard.DATA_DIR</span></b> </h6> <h6 class="pull-right"><b>All non-absolute folder locations are relative to <span class="path">$sickbeard.DATA_DIR</span></b> </h6>
<input type="submit" class="btn pull-left config_submitter button" value="Save Changes" /> <input type="submit" class="btn pull-left config_submitter button" value="Save Changes">
</form> </form>
</div> </div>

View file

@ -1,525 +1,528 @@
$(document).ready(function () { $(document).ready(function () {
// http://stackoverflow.com/questions/2219924/idiomatic-jquery-delayed-event-only-after-a-short-pause-in-typing-e-g-timew // http://stackoverflow.com/questions/2219924/idiomatic-jquery-delayed-event-only-after-a-short-pause-in-typing-e-g-timew
var typewatch = (function () { var typewatch = (function () {
var timer = 0; var timer = 0;
return function (callback, ms) { return function (callback, ms) {
clearTimeout(timer); clearTimeout(timer);
timer = setTimeout(callback, ms); timer = setTimeout(callback, ms);
}; };
})(); })();
function israr_supported() { function israr_supported() {
var pattern = $('#naming_pattern').val(); var pattern = $('#naming_pattern').val();
$.get(sbRoot + '/config/postProcessing/isRarSupported', $.get(sbRoot + '/config/postProcessing/isRarSupported',
function (data) { function (data) {
if (data == "supported") { if (data == "supported") {
} else { } else {
$('#unpack').qtip('option', { $('#unpack').qtip('option', {
'content.text': 'Unrar Executable not found.', 'content.text': 'Unrar Executable not found.',
'style.classes': 'qtip-red qtip-rounded qtip-shadow' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#unpack').qtip('toggle', true); $('#unpack').qtip('toggle', true);
$('#unpack').css('background-color', '#FFFFDD'); $('#unpack').css('background-color', '#FFFFDD');
} }
}); });
} }
function fill_examples() { function fill_examples() {
var pattern = $('#naming_pattern').val(); var pattern = $('#naming_pattern').val();
var multi = $('#naming_multi_ep :selected').val(); var multi = $('#naming_multi_ep :selected').val();
var anime_type = $('input[name="naming_anime"]:checked').val(); var anime_type = $('input[name="naming_anime"]:checked').val();
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, anime_type: 3}, $.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, anime_type: 3},
function (data) { function (data) {
if (data) { if (data) {
$('#naming_example').text(data + '.ext'); $('#naming_example').text(data + '.ext');
$('#naming_example_div').show(); $('#naming_example_div').show();
} else { } else {
$('#naming_example_div').hide(); $('#naming_example_div').hide();
} }
}); });
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, multi: multi, anime_type: 3}, $.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, multi: multi, anime_type: 3},
function (data) { function (data) {
if (data) { if (data) {
$('#naming_example_multi').text(data + '.ext'); $('#naming_example_multi').text(data + '.ext');
$('#naming_example_multi_div').show(); $('#naming_example_multi_div').show();
} else { } else {
$('#naming_example_multi_div').hide(); $('#naming_example_multi_div').hide();
} }
}); });
$.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, multi: multi, anime_type: anime_type}, $.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, multi: multi, anime_type: anime_type},
function (data) { function (data) {
if (data == "invalid") { if (data == "invalid") {
$('#naming_pattern').qtip('option', { $('#naming_pattern').qtip('option', {
'content.text': 'This pattern is invalid.', 'content.text': 'This pattern is invalid.',
'style.classes': 'qtip-red qtip-rounded qtip-shadow' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_pattern').qtip('toggle', true); $('#naming_pattern').qtip('toggle', true);
$('#naming_pattern').css('background-color', '#FFDDDD'); $('#naming_pattern').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") { } else if (data == "seasonfolders") {
$('#naming_pattern').qtip('option', { $('#naming_pattern').qtip('option', {
'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.', 'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.',
'style.classes': 'qtip-red qtip-rounded qtip-shadow' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_pattern').qtip('toggle', true); $('#naming_pattern').qtip('toggle', true);
$('#naming_pattern').css('background-color', '#FFFFDD'); $('#naming_pattern').css('background-color', '#FFFFDD');
} else { } else {
$('#naming_pattern').qtip('option', { $('#naming_pattern').qtip('option', {
'content.text': 'This pattern is valid.', 'content.text': 'This pattern is valid.',
'style.classes': 'qtip-green qtip-rounded qtip-shadow' 'style.classes': 'qtip-green qtip-rounded qtip-shadow'
}); });
$('#naming_pattern').qtip('toggle', false); $('#naming_pattern').qtip('toggle', false);
$('#naming_pattern').css('background-color', '#FFFFFF'); $('#naming_pattern').css('background-color', '#FFFFFF');
} }
}); });
} }
function fill_abd_examples() { function fill_abd_examples() {
var pattern = $('#naming_abd_pattern').val(); var pattern = $('#naming_abd_pattern').val();
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, abd: 'True'}, $.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, abd: 'True'},
function (data) { function (data) {
if (data) { if (data) {
$('#naming_abd_example').text(data + '.ext'); $('#naming_abd_example').text(data + '.ext');
$('#naming_abd_example_div').show(); $('#naming_abd_example_div').show();
} else { } else {
$('#naming_abd_example_div').hide(); $('#naming_abd_example_div').hide();
} }
}); });
$.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, abd: 'True'}, $.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, abd: 'True'},
function (data) { function (data) {
if (data == "invalid") { if (data == "invalid") {
$('#naming_abd_pattern').qtip('option', { $('#naming_abd_pattern').qtip('option', {
'content.text': 'This pattern is invalid.', 'content.text': 'This pattern is invalid.',
'style.classes': 'qtip-red qtip-rounded qtip-shadow' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_abd_pattern').qtip('toggle', true); $('#naming_abd_pattern').qtip('toggle', true);
$('#naming_abd_pattern').css('background-color', '#FFDDDD'); $('#naming_abd_pattern').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") { } else if (data == "seasonfolders") {
$('#naming_abd_pattern').qtip('option', { $('#naming_abd_pattern').qtip('option', {
'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.', 'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.',
'style.classes': 'qtip-red qtip-rounded qtip-shadow' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_abd_pattern').qtip('toggle', true); $('#naming_abd_pattern').qtip('toggle', true);
$('#naming_abd_pattern').css('background-color', '#FFFFDD'); $('#naming_abd_pattern').css('background-color', '#FFFFDD');
} else { } else {
$('#naming_abd_pattern').qtip('option', { $('#naming_abd_pattern').qtip('option', {
'content.text': 'This pattern is valid.', 'content.text': 'This pattern is valid.',
'style.classes': 'qtip-green qtip-rounded qtip-shadow' 'style.classes': 'qtip-green qtip-rounded qtip-shadow'
}); });
$('#naming_abd_pattern').qtip('toggle', false); $('#naming_abd_pattern').qtip('toggle', false);
$('#naming_abd_pattern').css('background-color', '#FFFFFF'); $('#naming_abd_pattern').css('background-color', '#FFFFFF');
} }
}); });
} }
function fill_sports_examples() { function fill_sports_examples() {
var pattern = $('#naming_sports_pattern').val(); var pattern = $('#naming_sports_pattern').val();
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, sports: 'True'}, $.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, sports: 'True'},
function (data) { function (data) {
if (data) { if (data) {
$('#naming_sports_example').text(data + '.ext'); $('#naming_sports_example').text(data + '.ext');
$('#naming_sports_example_div').show(); $('#naming_sports_example_div').show();
} else { } else {
$('#naming_sports_example_div').hide(); $('#naming_sports_example_div').hide();
} }
}); });
$.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, sports: 'True'}, $.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, sports: 'True'},
function (data) { function (data) {
if (data == "invalid") { if (data == "invalid") {
$('#naming_sports_pattern').qtip('option', { $('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern is invalid.', 'content.text': 'This pattern is invalid.',
'style.classes': 'qtip-red qtip-rounded qtip-shadow' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_sports_pattern').qtip('toggle', true); $('#naming_sports_pattern').qtip('toggle', true);
$('#naming_sports_pattern').css('background-color', '#FFDDDD'); $('#naming_sports_pattern').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") { } else if (data == "seasonfolders") {
$('#naming_sports_pattern').qtip('option', { $('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.', 'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.',
'style.classes': 'qtip-red qtip-rounded qtip-shadow' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_sports_pattern').qtip('toggle', true); $('#naming_sports_pattern').qtip('toggle', true);
$('#naming_sports_pattern').css('background-color', '#FFFFDD'); $('#naming_sports_pattern').css('background-color', '#FFFFDD');
} else { } else {
$('#naming_sports_pattern').qtip('option', { $('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern is valid.', 'content.text': 'This pattern is valid.',
'style.classes': 'qtip-green qtip-rounded qtip-shadow' 'style.classes': 'qtip-green qtip-rounded qtip-shadow'
}); });
$('#naming_sports_pattern').qtip('toggle', false); $('#naming_sports_pattern').qtip('toggle', false);
$('#naming_sports_pattern').css('background-color', '#FFFFFF'); $('#naming_sports_pattern').css('background-color', '#FFFFFF');
} }
}); });
} }
function fill_sports_examples() { function fill_sports_examples() {
var pattern = $('#naming_sports_pattern').val(); var pattern = $('#naming_sports_pattern').val();
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, sports: 'True'}, $.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, sports: 'True'},
function (data) { function (data) {
if (data) { if (data) {
$('#naming_sports_example').text(data + '.ext'); $('#naming_sports_example').text(data + '.ext');
$('#naming_sports_example_div').show(); $('#naming_sports_example_div').show();
} else { } else {
$('#naming_sports_example_div').hide(); $('#naming_sports_example_div').hide();
} }
}); });
$.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, sports: 'True'}, $.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, sports: 'True'},
function (data) { function (data) {
if (data == "invalid") { if (data == "invalid") {
$('#naming_sports_pattern').qtip('option', { $('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern is invalid.', 'content.text': 'This pattern is invalid.',
'style.classes': 'qtip-red qtip-rounded qtip-shadow' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_sports_pattern').qtip('toggle', true); $('#naming_sports_pattern').qtip('toggle', true);
$('#naming_sports_pattern').css('background-color', '#FFDDDD'); $('#naming_sports_pattern').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") { } else if (data == "seasonfolders") {
$('#naming_sports_pattern').qtip('option', { $('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.', 'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.',
'style.classes': 'qtip-red qtip-rounded qtip-shadow' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_sports_pattern').qtip('toggle', true); $('#naming_sports_pattern').qtip('toggle', true);
$('#naming_sports_pattern').css('background-color', '#FFFFDD'); $('#naming_sports_pattern').css('background-color', '#FFFFDD');
} else { } else {
$('#naming_sports_pattern').qtip('option', { $('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern is valid.', 'content.text': 'This pattern is valid.',
'style.classes': 'qtip-green qtip-rounded qtip-shadow' 'style.classes': 'qtip-green qtip-rounded qtip-shadow'
}); });
$('#naming_sports_pattern').qtip('toggle', false); $('#naming_sports_pattern').qtip('toggle', false);
$('#naming_sports_pattern').css('background-color', '#FFFFFF'); $('#naming_sports_pattern').css('background-color', '#FFFFFF');
} }
}); });
} }
function fill_anime_examples() { function fill_anime_examples() {
var pattern = $('#naming_anime_pattern').val(); var pattern = $('#naming_anime_pattern').val();
var multi = $('#naming_anime_multi_ep :selected').val(); var multi = $('#naming_anime_multi_ep :selected').val();
var anime_type = $('input[name="naming_anime"]:checked').val(); var anime_type = $('input[name="naming_anime"]:checked').val();
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, anime_type: anime_type}, $.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, anime_type: anime_type},
function (data) { function (data) {
if (data) { if (data) {
$('#naming_example_anime').text(data + '.ext'); $('#naming_example_anime').text(data + '.ext');
$('#naming_example_anime_div').show(); $('#naming_example_anime_div').show();
} else { } else {
$('#naming_example_anime_div').hide(); $('#naming_example_anime_div').hide();
} }
}); });
$.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, multi: multi, anime_type: anime_type}, $.get(sbRoot + '/config/postProcessing/testNaming', {pattern: pattern, multi: multi, anime_type: anime_type},
function (data) { function (data) {
if (data) { if (data) {
$('#naming_example_multi_anime').text(data + '.ext'); $('#naming_example_multi_anime').text(data + '.ext');
$('#naming_example_multi_anime_div').show(); $('#naming_example_multi_anime_div').show();
} else { } else {
$('#naming_example_multi_anime_div').hide(); $('#naming_example_multi_anime_div').hide();
} }
}); });
$.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, multi: multi, anime_type: anime_type}, $.get(sbRoot + '/config/postProcessing/isNamingValid', {pattern: pattern, multi: multi, anime_type: anime_type},
function (data) { function (data) {
if (data == "invalid") { if (data == "invalid") {
$('#naming_anime_pattern').qtip('option', { $('#naming_anime_pattern').qtip('option', {
'content.text': 'This pattern is invalid.', 'content.text': 'This pattern is invalid.',
'style.classes': 'qtip-red qtip-rounded qtip-shadow' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_anime_pattern').qtip('toggle', true); $('#naming_anime_pattern').qtip('toggle', true);
$('#naming_anime_pattern').css('background-color', '#FFDDDD'); $('#naming_anime_pattern').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") { } else if (data == "seasonfolders") {
$('#naming_anime_pattern').qtip('option', { $('#naming_anime_pattern').qtip('option', {
'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.', 'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.',
'style.classes': 'qtip-red qtip-rounded qtip-shadow' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_anime_pattern').qtip('toggle', true); $('#naming_anime_pattern').qtip('toggle', true);
$('#naming_anime_pattern').css('background-color', '#FFFFDD'); $('#naming_anime_pattern').css('background-color', '#FFFFDD');
} else { } else {
$('#naming_anime_pattern').qtip('option', { $('#naming_anime_pattern').qtip('option', {
'content.text': 'This pattern is valid.', 'content.text': 'This pattern is valid.',
'style.classes': 'qtip-green qtip-rounded qtip-shadow' 'style.classes': 'qtip-green qtip-rounded qtip-shadow'
}); });
$('#naming_anime_pattern').qtip('toggle', false); $('#naming_anime_pattern').qtip('toggle', false);
$('#naming_anime_pattern').css('background-color', '#FFFFFF'); $('#naming_anime_pattern').css('background-color', '#FFFFFF');
} }
}); });
} }
function setup_naming() { function setup_naming() {
// if it is a custom selection then show the text box // if it is a custom selection then show the text box
if ($('#name_presets :selected').val() == "Custom...") { if ($('#name_presets :selected').val() == "Custom...") {
$('#naming_custom').show(); $('#naming_custom').show();
} else { } else {
$('#naming_custom').hide(); $('#naming_custom').hide();
$('#naming_pattern').val($('#name_presets :selected').attr('id')); $('#naming_pattern').val($('#name_presets :selected').attr('id'));
}
fill_examples();
}
function setup_abd_naming() {
// if it is a custom selection then show the text box
if ($('#name_abd_presets :selected').val() == "Custom...") {
$('#naming_abd_custom').show();
} else {
$('#naming_abd_custom').hide();
$('#naming_abd_pattern').val($('#name_abd_presets :selected').attr('id'));
}
fill_abd_examples();
}
function setup_sports_naming() {
// if it is a custom selection then show the text box
if ($('#name_sports_presets :selected').val() == "Custom...") {
$('#naming_sports_custom').show();
} else {
$('#naming_sports_custom').hide();
$('#naming_sports_pattern').val($('#name_sports_presets :selected').attr('id'));
}
fill_sports_examples();
}
function setup_anime_naming() {
// if it is a custom selection then show the text box
if ($('#name_anime_presets :selected').val() == "Custom...") {
$('#naming_anime_custom').show();
} else {
$('#naming_anime_custom').hide();
$('#naming_anime_pattern').val($('#name_anime_presets :selected').attr('id'));
}
fill_anime_examples();
}
$('#unpack').change(function () {
if(this.checked) {
israr_supported();
} else {
$('#unpack').qtip('toggle', false);
} }
}); fill_examples();
}
$('#name_presets').change(function () { function setup_abd_naming() {
setup_naming(); // if it is a custom selection then show the text box
}); if ($('#name_abd_presets :selected').val() == "Custom...") {
$('#naming_abd_custom').show();
} else {
$('#naming_abd_custom').hide();
$('#naming_abd_pattern').val($('#name_abd_presets :selected').attr('id'));
}
fill_abd_examples();
}
$('#name_abd_presets').change(function () { function setup_sports_naming() {
setup_abd_naming(); // if it is a custom selection then show the text box
}); if ($('#name_sports_presets :selected').val() == "Custom...") {
$('#naming_sports_custom').show();
} else {
$('#naming_sports_custom').hide();
$('#naming_sports_pattern').val($('#name_sports_presets :selected').attr('id'));
}
fill_sports_examples();
}
$('#naming_custom_abd').change(function () { function setup_anime_naming() {
setup_abd_naming(); // if it is a custom selection then show the text box
}); if ($('#name_anime_presets :selected').val() == "Custom...") {
$('#naming_anime_custom').show();
} else {
$('#naming_anime_custom').hide();
$('#naming_anime_pattern').val($('#name_anime_presets :selected').attr('id'));
}
fill_anime_examples();
}
$('#name_sports_presets').change(function () { $('#unpack').change(function () {
setup_sports_naming(); if(this.checked) {
}); israr_supported();
} else {
$('#unpack').qtip('toggle', false);
}
});
$('#naming_custom_sports').change(function () { $('#name_presets').change(function () {
setup_sports_naming(); setup_naming();
}); });
$('#name_anime_presets').change(function () { $('#name_abd_presets').change(function () {
setup_anime_naming(); setup_abd_naming();
}); });
$('#naming_custom_anime').change(function () { $('#naming_custom_abd').change(function () {
setup_anime_naming(); setup_abd_naming();
}); });
$('input[name="naming_anime"]').click(function(){ $('#name_sports_presets').change(function () {
setup_anime_naming(); setup_sports_naming();
}); });
$('#naming_multi_ep').change(fill_examples); $('#naming_custom_sports').change(function () {
$('#naming_pattern').focusout(fill_examples); setup_sports_naming();
$('#naming_pattern').keyup(function () { });
typewatch(function () {
fill_examples();
}, 500);
});
$('#naming_anime_multi_ep').change(fill_anime_examples); $('#name_anime_presets').change(function () {
$('#naming_anime_pattern').focusout(fill_anime_examples); setup_anime_naming();
$('#naming_anime_pattern').keyup(function () { });
typewatch(function () {
fill_anime_examples();
}, 500);
});
$('#naming_abd_pattern').focusout(fill_examples); $('#naming_custom_anime').change(function () {
$('#naming_abd_pattern').keyup(function () { setup_anime_naming();
typewatch(function () { });
fill_abd_examples();
}, 500);
});
$('#naming_sports_pattern').focusout(fill_examples); $('input[name="naming_anime"]').click(function(){
$('#naming_sports_pattern').keyup(function () { setup_anime_naming();
typewatch(function () { });
fill_sports_examples();
}, 500);
});
$('#naming_anime_pattern').focusout(fill_examples); $('#naming_multi_ep').change(fill_examples);
$('#naming_anime_pattern').keyup(function () { $('#naming_pattern').focusout(fill_examples);
typewatch(function () { $('#naming_pattern').keyup(function () {
fill_anime_examples(); typewatch(function () {
}, 500); fill_examples();
}); }, 500);
});
$('#show_naming_key').click(function () { $('#naming_anime_multi_ep').change(fill_anime_examples);
$('#naming_key').toggle(); $('#naming_anime_pattern').focusout(fill_anime_examples);
}); $('#naming_anime_pattern').keyup(function () {
$('#show_naming_abd_key').click(function () { typewatch(function () {
$('#naming_abd_key').toggle(); fill_anime_examples();
}); }, 500);
$('#show_naming_sports_key').click(function () { });
$('#naming_sports_key').toggle();
}); $('#naming_abd_pattern').focusout(fill_examples);
$('#show_naming_anime_key').click(function () { $('#naming_abd_pattern').keyup(function () {
$('#naming_anime_key').toggle(); typewatch(function () {
}); fill_abd_examples();
$('#do_custom').click(function () { }, 500);
$('#naming_pattern').val($('#name_presets :selected').attr('id')); });
$('#naming_custom').show();
$('#naming_pattern').focus(); $('#naming_sports_pattern').focusout(fill_examples);
}); $('#naming_sports_pattern').keyup(function () {
setup_naming(); typewatch(function () {
setup_abd_naming(); fill_sports_examples();
setup_sports_naming(); }, 500);
setup_anime_naming(); });
$('#naming_anime_pattern').focusout(fill_examples);
$('#naming_anime_pattern').keyup(function () {
typewatch(function () {
fill_anime_examples();
}, 500);
});
$('#show_extra_params').click(function () {
$('#extra_params').toggle();
});
$('#show_naming_key').click(function () {
$('#naming_key').toggle();
});
$('#show_naming_abd_key').click(function () {
$('#naming_abd_key').toggle();
});
$('#show_naming_sports_key').click(function () {
$('#naming_sports_key').toggle();
});
$('#show_naming_anime_key').click(function () {
$('#naming_anime_key').toggle();
});
$('#do_custom').click(function () {
$('#naming_pattern').val($('#name_presets :selected').attr('id'));
$('#naming_custom').show();
$('#naming_pattern').focus();
});
setup_naming();
setup_abd_naming();
setup_sports_naming();
setup_anime_naming();
// -- start of metadata options div toggle code -- // -- start of metadata options div toggle code --
$('#metadataType').on('change keyup', function () { $('#metadataType').on('change keyup', function () {
$(this).showHideMetadata(); $(this).showHideMetadata();
}); });
$.fn.showHideMetadata = function () { $.fn.showHideMetadata = function () {
$('.metadataDiv').each(function () { $('.metadataDiv').each(function () {
var targetName = $(this).attr('id'); var targetName = $(this).attr('id');
var selectedTarget = $('#metadataType :selected').val(); var selectedTarget = $('#metadataType :selected').val();
if (selectedTarget == targetName) { if (selectedTarget == targetName) {
$(this).show(); $(this).show();
} else { } else {
$(this).hide(); $(this).hide();
} }
}); });
}; };
//initialize to show the div //initialize to show the div
$(this).showHideMetadata(); $(this).showHideMetadata();
// -- end of metadata options div toggle code -- // -- end of metadata options div toggle code --
$('.metadata_checkbox').click(function () { $('.metadata_checkbox').click(function () {
$(this).refreshMetadataConfig(false); $(this).refreshMetadataConfig(false);
}); });
$.fn.refreshMetadataConfig = function (first) { $.fn.refreshMetadataConfig = function (first) {
var cur_most = 0; var cur_most = 0;
var cur_most_provider = ''; var cur_most_provider = '';
$('.metadataDiv').each(function () { $('.metadataDiv').each(function () {
var generator_name = $(this).attr('id'); var generator_name = $(this).attr('id');
var config_arr = []; var config_arr = [];
var show_metadata = $("#" + generator_name + "_show_metadata").prop('checked'); var show_metadata = $("#" + generator_name + "_show_metadata").prop('checked');
var episode_metadata = $("#" + generator_name + "_episode_metadata").prop('checked'); var episode_metadata = $("#" + generator_name + "_episode_metadata").prop('checked');
var fanart = $("#" + generator_name + "_fanart").prop('checked'); var fanart = $("#" + generator_name + "_fanart").prop('checked');
var poster = $("#" + generator_name + "_poster").prop('checked'); var poster = $("#" + generator_name + "_poster").prop('checked');
var banner = $("#" + generator_name + "_banner").prop('checked'); var banner = $("#" + generator_name + "_banner").prop('checked');
var episode_thumbnails = $("#" + generator_name + "_episode_thumbnails").prop('checked'); var episode_thumbnails = $("#" + generator_name + "_episode_thumbnails").prop('checked');
var season_posters = $("#" + generator_name + "_season_posters").prop('checked'); var season_posters = $("#" + generator_name + "_season_posters").prop('checked');
var season_banners = $("#" + generator_name + "_season_banners").prop('checked'); var season_banners = $("#" + generator_name + "_season_banners").prop('checked');
var season_all_poster = $("#" + generator_name + "_season_all_poster").prop('checked'); var season_all_poster = $("#" + generator_name + "_season_all_poster").prop('checked');
var season_all_banner = $("#" + generator_name + "_season_all_banner").prop('checked'); var season_all_banner = $("#" + generator_name + "_season_all_banner").prop('checked');
config_arr.push(show_metadata ? '1' : '0'); config_arr.push(show_metadata ? '1' : '0');
config_arr.push(episode_metadata ? '1' : '0'); config_arr.push(episode_metadata ? '1' : '0');
config_arr.push(fanart ? '1' : '0'); config_arr.push(fanart ? '1' : '0');
config_arr.push(poster ? '1' : '0'); config_arr.push(poster ? '1' : '0');
config_arr.push(banner ? '1' : '0'); config_arr.push(banner ? '1' : '0');
config_arr.push(episode_thumbnails ? '1' : '0'); config_arr.push(episode_thumbnails ? '1' : '0');
config_arr.push(season_posters ? '1' : '0'); config_arr.push(season_posters ? '1' : '0');
config_arr.push(season_banners ? '1' : '0'); config_arr.push(season_banners ? '1' : '0');
config_arr.push(season_all_poster ? '1' : '0'); config_arr.push(season_all_poster ? '1' : '0');
config_arr.push(season_all_banner ? '1' : '0'); config_arr.push(season_all_banner ? '1' : '0');
var cur_num = 0; var cur_num = 0;
for (var i = 0; i < config_arr.length; i++) { for (var i = 0; i < config_arr.length; i++) {
cur_num += parseInt(config_arr[i]); cur_num += parseInt(config_arr[i]);
} }
if (cur_num > cur_most) { if (cur_num > cur_most) {
cur_most = cur_num; cur_most = cur_num;
cur_most_provider = generator_name; cur_most_provider = generator_name;
} }
$("#" + generator_name + "_eg_show_metadata").attr('class', show_metadata ? 'enabled' : 'disabled'); $("#" + generator_name + "_eg_show_metadata").attr('class', show_metadata ? 'enabled' : 'disabled');
$("#" + generator_name + "_eg_episode_metadata").attr('class', episode_metadata ? 'enabled' : 'disabled'); $("#" + generator_name + "_eg_episode_metadata").attr('class', episode_metadata ? 'enabled' : 'disabled');
$("#" + generator_name + "_eg_fanart").attr('class', fanart ? 'enabled' : 'disabled'); $("#" + generator_name + "_eg_fanart").attr('class', fanart ? 'enabled' : 'disabled');
$("#" + generator_name + "_eg_poster").attr('class', poster ? 'enabled' : 'disabled'); $("#" + generator_name + "_eg_poster").attr('class', poster ? 'enabled' : 'disabled');
$("#" + generator_name + "_eg_banner").attr('class', banner ? 'enabled' : 'disabled'); $("#" + generator_name + "_eg_banner").attr('class', banner ? 'enabled' : 'disabled');
$("#" + generator_name + "_eg_episode_thumbnails").attr('class', episode_thumbnails ? 'enabled' : 'disabled'); $("#" + generator_name + "_eg_episode_thumbnails").attr('class', episode_thumbnails ? 'enabled' : 'disabled');
$("#" + generator_name + "_eg_season_posters").attr('class', season_posters ? 'enabled' : 'disabled'); $("#" + generator_name + "_eg_season_posters").attr('class', season_posters ? 'enabled' : 'disabled');
$("#" + generator_name + "_eg_season_banners").attr('class', season_banners ? 'enabled' : 'disabled'); $("#" + generator_name + "_eg_season_banners").attr('class', season_banners ? 'enabled' : 'disabled');
$("#" + generator_name + "_eg_season_all_poster").attr('class', season_all_poster ? 'enabled' : 'disabled'); $("#" + generator_name + "_eg_season_all_poster").attr('class', season_all_poster ? 'enabled' : 'disabled');
$("#" + generator_name + "_eg_season_all_banner").attr('class', season_all_banner ? 'enabled' : 'disabled'); $("#" + generator_name + "_eg_season_all_banner").attr('class', season_all_banner ? 'enabled' : 'disabled');
$("#" + generator_name + "_data").val(config_arr.join('|')); $("#" + generator_name + "_data").val(config_arr.join('|'));
}); });
if (cur_most_provider != '' && first) { if (cur_most_provider != '' && first) {
$('#metadataType option[value=' + cur_most_provider + ']').attr('selected', 'selected'); $('#metadataType option[value=' + cur_most_provider + ']').attr('selected', 'selected');
$(this).showHideMetadata(); $(this).showHideMetadata();
} }
} }
$(this).refreshMetadataConfig(true); $(this).refreshMetadataConfig(true);
$('img[title]').qtip({ $('img[title]').qtip({
position: { position: {
viewport: $(window), viewport: $(window),
my: 'top right', my: 'top right',
at: 'bottom center' at: 'bottom center'
}, },
style: { style: {
classes: 'qtip-dark qtip-rounded qtip-shadow' classes: 'qtip-dark qtip-rounded qtip-shadow'
} }
}); });
$('i[title]').qtip({ $('i[title]').qtip({
position: { position: {
viewport: $(window), viewport: $(window),
my: 'bottom center', my: 'bottom center',
at: 'top center' at: 'top center'
}, },
style: { style: {
classes: 'qtip-rounded qtip-shadow' classes: 'qtip-rounded qtip-shadow'
} }
}); });
$('.custom-pattern,#unpack').qtip({ $('.custom-pattern,#unpack').qtip({
content: 'validating...', content: 'validating...',
show: { show: {
event: false, event: false,
ready: false ready: false
}, },
hide: false, hide: false,
position: { position: {
viewport: $(window), viewport: $(window),
my: 'right center', my: 'right center',
at: 'left center' at: 'left center'
}, },
style: { style: {
classes: 'qtip-red qtip-rounded qtip-shadow' classes: 'qtip-red qtip-rounded qtip-shadow'
} }
}); });
}); });