Post-Processing Score tag Added

pull/1038/head
Halali 5 years ago
parent 84ad5aaeaa
commit 9bd725beb2

@ -220,10 +220,10 @@ def download_subtitle(path, language, audio_language, hi, forced, providers, pro
+ "%." + "%."
if use_postprocessing is True: if use_postprocessing is True:
percent_score = round(subtitle.score * 100 / max_score, 2)
command = pp_replace(postprocessing_cmd, path, downloaded_path, downloaded_language, command = pp_replace(postprocessing_cmd, path, downloaded_path, downloaded_language,
downloaded_language_code2, downloaded_language_code3, audio_language, downloaded_language_code2, downloaded_language_code3, audio_language,
audio_language_code2, audio_language_code3, subtitle.language.forced) audio_language_code2, audio_language_code3, subtitle.language.forced, percent_score)
percent_score = round(subtitle.score * 100 / max_score, 2)
if media_type == 'series': if media_type == 'series':
use_pp_threshold = settings.general.getboolean('use_postprocessing_threshold') use_pp_threshold = settings.general.getboolean('use_postprocessing_threshold')
@ -445,10 +445,10 @@ def manual_download_subtitle(path, language, audio_language, hi, forced, subtitl
score) + "% using manual search." score) + "% using manual search."
if use_postprocessing is True: if use_postprocessing is True:
percent_score = round(subtitle.score * 100 / max_score, 2)
command = pp_replace(postprocessing_cmd, path, downloaded_path, downloaded_language, command = pp_replace(postprocessing_cmd, path, downloaded_path, downloaded_language,
downloaded_language_code2, downloaded_language_code3, audio_language, downloaded_language_code2, downloaded_language_code3, audio_language,
audio_language_code2, audio_language_code3, subtitle.language.forced) audio_language_code2, audio_language_code3, subtitle.language.forced, percent_score)
percent_score = round(subtitle.score * 100 / max_score, 2)
if media_type == 'series': if media_type == 'series':
use_pp_threshold = settings.general.getboolean('use_postprocessing_threshold') use_pp_threshold = settings.general.getboolean('use_postprocessing_threshold')
@ -560,10 +560,10 @@ def manual_upload_subtitle(path, language, forced, title, scene_name, media_type
audio_language_code3 = alpha3_from_language(audio_language) audio_language_code3 = alpha3_from_language(audio_language)
if use_postprocessing is True: if use_postprocessing:
command = pp_replace(postprocessing_cmd, path, subtitle_path, uploaded_language, command = pp_replace(postprocessing_cmd, path, subtitle_path, uploaded_language,
uploaded_language_code2, uploaded_language_code3, audio_language, uploaded_language_code2, uploaded_language_code3, audio_language,
audio_language_code2, audio_language_code3, forced) audio_language_code2, audio_language_code3, forced, 100)
postprocessing(command, path) postprocessing(command, path)

@ -95,7 +95,7 @@ class PathMappings:
path_mappings = PathMappings() path_mappings = PathMappings()
def pp_replace(pp_command, episode, subtitles, language, language_code2, language_code3, episode_language, episode_language_code2, episode_language_code3, forced): def pp_replace(pp_command, episode, subtitles, language, language_code2, language_code3, episode_language, episode_language_code2, episode_language_code3, forced, score):
is_forced = ":forced" if forced else "" is_forced = ":forced" if forced else ""
is_forced_string = " forced" if forced else "" is_forced_string = " forced" if forced else ""
pp_command = pp_command.replace('{{directory}}', os.path.dirname(episode)) pp_command = pp_command.replace('{{directory}}', os.path.dirname(episode))
@ -108,6 +108,7 @@ def pp_replace(pp_command, episode, subtitles, language, language_code2, languag
pp_command = pp_command.replace('{{episode_language}}', episode_language) pp_command = pp_command.replace('{{episode_language}}', episode_language)
pp_command = pp_command.replace('{{episode_language_code2}}', episode_language_code2) pp_command = pp_command.replace('{{episode_language_code2}}', episode_language_code2)
pp_command = pp_command.replace('{{episode_language_code3}}', episode_language_code3) pp_command = pp_command.replace('{{episode_language_code3}}', episode_language_code3)
pp_command = pp_command.replace('{{score}}', score)
return pp_command return pp_command

@ -130,7 +130,7 @@
<!-- ============================================================== --> <!-- ============================================================== -->
<!-- Search --> <!-- Search -->
<!-- ============================================================== --> <!-- ============================================================== -->
<li class="nav-item hidden-sm-down search-box"> <li class="nav-item search-box">
<form class="form-material"> <form class="form-material">
<div class="typeahead__container"> <div class="typeahead__container">
<div class="typeahead__field"> <div class="typeahead__field">

@ -11,7 +11,8 @@
<button class="btn btn-outline" id="save_button"> <button class="btn btn-outline" id="save_button">
<div> <div>
<span class="fa-stack"> <span class="fa-stack">
<i class="fas fa-save fa-stack-2x align-top text-themecolor text-center font-20" aria-hidden="true"></i> <i class="fas fa-save fa-stack-2x align-top text-themecolor text-center font-20"
aria-hidden="true"></i>
<i id="save_button_checkmark" class="fas fa-check fa-stack-2x" style="color:green;"></i> <i id="save_button_checkmark" class="fas fa-check fa-stack-2x" style="color:green;"></i>
</span> </span>
</div> </div>
@ -34,21 +35,24 @@
<b>Subtitle Folder</b> <b>Subtitle Folder</b>
</div> </div>
<div class="form-group col-sm-4"> <div class="form-group col-sm-4">
<select class="form-control selectpicker" id="settings-general-subfolder" name="settings-general-subfolder"> <select class="form-control selectpicker" id="settings-general-subfolder"
name="settings-general-subfolder">
<option value="current">Alongside Media File</option> <option value="current">Alongside Media File</option>
<option value="relative">Relative Path To Media File</option> <option value="relative">Relative Path To Media File</option>
<option value="absolute">Absolute Path</option> <option value="absolute">Absolute Path</option>
</select> </select>
<label for="settings-general-subfolder">Choose the folder you wish to store/read the Subtitles</label> <label for="settings-general-subfolder">Choose the folder you wish to store/read the
Subtitles</label>
</div> </div>
</div> </div>
<div id="subfolder_div"> <div id="subfolder_div">
<div class="row"> <div class="row">
<div class="col-sm-3 text-right"> <div class="col-sm-3 text-right">
<b>Custom Subtitle Folder</b> <b>Custom Subtitle Folder</b>
</div> </div>
<div class="col-sm-4"> <div class="col-sm-4">
<input type="text" class="form-control" id="settings-general-subfolder_custom" name="settings-general-subfolder_custom" value="{{settings.general.subfolder_custom}}"> <input type="text" class="form-control" id="settings-general-subfolder_custom"
name="settings-general-subfolder_custom" value="{{ settings.general.subfolder_custom }}">
<label for="settings-general-subfolder_custom">Choose your own folder for Subtitles</label> <label for="settings-general-subfolder_custom">Choose your own folder for Subtitles</label>
</div> </div>
</div> </div>
@ -60,7 +64,8 @@
</div> </div>
<div class="form-group col-sm-8"> <div class="form-group col-sm-8">
<label class="custom-control custom-checkbox"> <label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="settings-general-upgrade_subs" name="settings-general-upgrade_subs"> <input type="checkbox" class="custom-control-input" id="settings-general-upgrade_subs"
name="settings-general-upgrade_subs">
<span class="custom-control-label" for="settings-general-upgrade_subs"></span> <span class="custom-control-label" for="settings-general-upgrade_subs"></span>
</label> </label>
<label>Schedule a task to upgrade Subtitles previously downloaded by Bazarr.</label> <label>Schedule a task to upgrade Subtitles previously downloaded by Bazarr.</label>
@ -73,7 +78,9 @@
<b>Number of days to go back in history to upgrade subtitles (up to 30)</b> <b>Number of days to go back in history to upgrade subtitles (up to 30)</b>
</div> </div>
<div class="col-sm-4"> <div class="col-sm-4">
<input type="number" class="form-control" id="settings-general-days_to_upgrade_subs" name="settings-general-days_to_upgrade_subs" min="1" max="30" value="{{settings.general.days_to_upgrade_subs}}" onkeydown="return false"> <input type="number" class="form-control" id="settings-general-days_to_upgrade_subs"
name="settings-general-days_to_upgrade_subs" min="1" max="30"
value="{{ settings.general.days_to_upgrade_subs }}" onkeydown="return false">
</div> </div>
</div> </div>
<br> <br>
@ -83,7 +90,8 @@
</div> </div>
<div class="form-group col-sm-8"> <div class="form-group col-sm-8">
<label class="custom-control custom-checkbox"> <label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="settings-general-upgrade_manual" name="settings-general-upgrade_manual"> <input type="checkbox" class="custom-control-input" id="settings-general-upgrade_manual"
name="settings-general-upgrade_manual">
<span class="custom-control-label" for="settings-general-upgrade_manual"></span> <span class="custom-control-label" for="settings-general-upgrade_manual"></span>
</label> </label>
<label>Enable or disable upgrade of manually searched and downloaded Subtitles.</label> <label>Enable or disable upgrade of manually searched and downloaded Subtitles.</label>
@ -99,15 +107,17 @@
<b>Provider</b> <b>Provider</b>
</div> </div>
<div class="form-group col-sm-4"> <div class="form-group col-sm-4">
<select class="form-control selectpicker" id="settings-general-anti_captcha_provider" name="settings-general-anti_captcha_provider"> <select class="form-control selectpicker" id="settings-general-anti_captcha_provider"
name="settings-general-anti_captcha_provider">
<option value="None">None</option> <option value="None">None</option>
<option value="anti-captcha">Anti-Captcha</option> <option value="anti-captcha">Anti-Captcha</option>
<option value="death-by-captcha">Death by Captcha</option> <option value="death-by-captcha">Death by Captcha</option>
</select> </select>
<label for="settings-general-anti_captcha_provider">Choose the Anti-Captcha provider you want to use.</label> <label for="settings-general-anti_captcha_provider">Choose the Anti-Captcha provider you want to
use.</label>
</div> </div>
</div> </div>
<div id="anticaptcha_div"> <div id="anticaptcha_div">
<div class="row"> <div class="row">
<div class="col-sm-4 text-right"> <div class="col-sm-4 text-right">
<b>Provider Website</b> <b>Provider Website</b>
@ -122,12 +132,14 @@
<b>Account Key</b> <b>Account Key</b>
</div> </div>
<div class="col-sm-4"> <div class="col-sm-4">
<input type="text" class="form-control" id="settings-anticaptcha-anti_captcha_key" name="settings-anticaptcha-anti_captcha_key" value="{{settings.anticaptcha.anti_captcha_key}}"> <input type="text" class="form-control" id="settings-anticaptcha-anti_captcha_key"
name="settings-anticaptcha-anti_captcha_key"
value="{{ settings.anticaptcha.anti_captcha_key }}">
</div> </div>
</div> </div>
<br> <br>
</div> </div>
<div id="deathbycaptcha_div"> <div id="deathbycaptcha_div">
<div class="row"> <div class="row">
<div class="col-sm-4 text-right"> <div class="col-sm-4 text-right">
<b>Provider Website</b> <b>Provider Website</b>
@ -142,7 +154,8 @@
<b>Username</b> <b>Username</b>
</div> </div>
<div class="col-sm-4"> <div class="col-sm-4">
<input type="text" class="form-control" id="settings-deathbycaptcha-username" name="settings-deathbycaptcha-username" value="{{settings.deathbycaptcha.username}}"> <input type="text" class="form-control" id="settings-deathbycaptcha-username"
name="settings-deathbycaptcha-username" value="{{ settings.deathbycaptcha.username }}">
</div> </div>
</div> </div>
<br> <br>
@ -151,7 +164,8 @@
<b>Password</b> <b>Password</b>
</div> </div>
<div class="col-sm-4"> <div class="col-sm-4">
<input type="password" class="form-control" id="settings-deathbycaptcha-password" name="settings-deathbycaptcha-password" value="{{settings.deathbycaptcha.password}}"> <input type="password" class="form-control" id="settings-deathbycaptcha-password"
name="settings-deathbycaptcha-password" value="{{ settings.deathbycaptcha.password }}">
</div> </div>
</div> </div>
<br> <br>
@ -165,10 +179,12 @@
</div> </div>
<div class="form-group col-sm-8"> <div class="form-group col-sm-8">
<label class="custom-control custom-checkbox"> <label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="settings-general-adaptive_searching" name="settings-general-adaptive_searching"> <input type="checkbox" class="custom-control-input" id="settings-general-adaptive_searching"
name="settings-general-adaptive_searching">
<span class="custom-control-label" for="settings-general-adaptive_searching"></span> <span class="custom-control-label" for="settings-general-adaptive_searching"></span>
</label> </label>
<label>When searching for Subtitles, Bazarr will search less frequently to limit call to providers.</label> <label>When searching for Subtitles, Bazarr will search less frequently to limit call to
providers.</label>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -177,7 +193,8 @@
</div> </div>
<div class="form-group col-sm-8"> <div class="form-group col-sm-8">
<label class="custom-control custom-checkbox"> <label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="settings-general-multithreading" name="settings-general-multithreading"> <input type="checkbox" class="custom-control-input" id="settings-general-multithreading"
name="settings-general-multithreading">
<span class="custom-control-label" for="settings-general-multithreading"></span> <span class="custom-control-label" for="settings-general-multithreading"></span>
</label> </label>
<label>Search multiple providers at once (Don't choose this on low powered devices)</label> <label>Search multiple providers at once (Don't choose this on low powered devices)</label>
@ -189,7 +206,8 @@
</div> </div>
<div class="form-group col-sm-8"> <div class="form-group col-sm-8">
<label class="custom-control custom-checkbox"> <label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="settings-general-use_embedded_subs" name="settings-general-use_embedded_subs"> <input type="checkbox" class="custom-control-input" id="settings-general-use_embedded_subs"
name="settings-general-use_embedded_subs">
<span class="custom-control-label" for="settings-general-use_embedded_subs"></span> <span class="custom-control-label" for="settings-general-use_embedded_subs"></span>
</label> </label>
<label>Use embedded Subtitles in media files when determining missing ones.</label> <label>Use embedded Subtitles in media files when determining missing ones.</label>
@ -202,10 +220,12 @@
</div> </div>
<div class="form-group col-sm-8"> <div class="form-group col-sm-8">
<label class="custom-control custom-checkbox"> <label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="settings-general-ignore_pgs_subs" name="settings-general-ignore_pgs_subs"> <input type="checkbox" class="custom-control-input" id="settings-general-ignore_pgs_subs"
name="settings-general-ignore_pgs_subs">
<span class="custom-control-label" for="settings-general-ignore_pgs_subs"></span> <span class="custom-control-label" for="settings-general-ignore_pgs_subs"></span>
</label> </label>
<label>Ignores PGS Subtitles in Embedded Subtitles detection. Only relevant if 'Use embedded Subtitles' is enabled.</label> <label>Ignores PGS Subtitles in Embedded Subtitles detection. Only relevant if 'Use embedded
Subtitles' is enabled.</label>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -214,7 +234,9 @@
</div> </div>
<div class="form-group col-sm-8"> <div class="form-group col-sm-8">
<label class="custom-control custom-checkbox"> <label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="settings-general-embedded_subs_show_desired" name="settings-general-embedded_subs_show_desired"> <input type="checkbox" class="custom-control-input"
id="settings-general-embedded_subs_show_desired"
name="settings-general-embedded_subs_show_desired">
<span class="custom-control-label" for="settings-general-embedded_subs_show_desired"></span> <span class="custom-control-label" for="settings-general-embedded_subs_show_desired"></span>
</label> </label>
<label>Hide embedded subtitles for languages that are not currently desired.</label> <label>Hide embedded subtitles for languages that are not currently desired.</label>
@ -230,36 +252,39 @@
</div> </div>
<div class="form-group col-sm-8"> <div class="form-group col-sm-8">
<label class="custom-control custom-checkbox"> <label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="settings-general-utf8_encode" name="settings-general-utf8_encode"> <input type="checkbox" class="custom-control-input" id="settings-general-utf8_encode"
name="settings-general-utf8_encode">
<span class="custom-control-label" for="settings-general-utf8_encode"></span> <span class="custom-control-label" for="settings-general-utf8_encode"></span>
</label> </label>
<label>Re-encode downloaded Subtitles to UTF8. Should be left enabled in most case.</label> <label>Re-encode downloaded Subtitles to UTF8. Should be left enabled in most case.</label>
</div> </div>
</div> </div>
{% if not os.startswith('win') %} {% if not os.startswith('win') %}
<div class="row">
<div class="col-sm-3 text-right">
<b>Enable CHMOD</b>
</div>
<div class="form-group col-sm-1">
<label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="settings-general-chmod_enabled" name="settings-general-chmod_enabled">
<span class="custom-control-label" for="settings-general-chmod_enabled"></span>
</label>
</div>
</div>
<div id="chmod_div">
<div class="row"> <div class="row">
<div class="col-sm-4 text-right"> <div class="col-sm-3 text-right">
<b>Set Subtitle file permissions to</b> <b>Enable CHMOD</b>
</div> </div>
<div class="col-sm-4"> <div class="form-group col-sm-1">
<input type="text" class="form-control" id="settings-general-chmod" name="settings-general-chmod" value="{{settings.general.chmod}}"> <label class="custom-control custom-checkbox">
<label for="settings-general-chmod">Must be 4 digit octal, e.g.: 0775</label> <input type="checkbox" class="custom-control-input" id="settings-general-chmod_enabled"
name="settings-general-chmod_enabled">
<span class="custom-control-label" for="settings-general-chmod_enabled"></span>
</label>
</div> </div>
</div> </div>
<br> <div id="chmod_div">
</div> <div class="row">
<div class="col-sm-4 text-right">
<b>Set Subtitle file permissions to</b>
</div>
<div class="col-sm-4">
<input type="text" class="form-control" id="settings-general-chmod"
name="settings-general-chmod" value="{{ settings.general.chmod }}">
<label for="settings-general-chmod">Must be 4 digit octal, e.g.: 0775</label>
</div>
</div>
<br>
</div>
{% endif %} {% endif %}
<div class="row"> <div class="row">
<div class="col-sm-3 text-right"> <div class="col-sm-3 text-right">
@ -267,7 +292,8 @@
</div> </div>
<div class="form-group col-sm-8"> <div class="form-group col-sm-8">
<label class="custom-control custom-checkbox"> <label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="settings-general-use_postprocessing" name="settings-general-use_postprocessing"> <input type="checkbox" class="custom-control-input" id="settings-general-use_postprocessing"
name="settings-general-use_postprocessing">
<span class="custom-control-label" for="settings-general-use_postprocessing"></span> <span class="custom-control-label" for="settings-general-use_postprocessing"></span>
</label> </label>
<label>Enable the post-processing execution after downloading a subtitles.</label> <label>Enable the post-processing execution after downloading a subtitles.</label>
@ -280,8 +306,11 @@
</div> </div>
<div class="col-sm-1"> <div class="col-sm-1">
<label class="custom-control custom-checkbox"> <label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="settings-general-use_postprocessing_threshold" name="settings-general-use_postprocessing_threshold"> <input type="checkbox" class="custom-control-input"
<span class="custom-control-label" for="settings-general-use_postprocessing_threshold"></span> id="settings-general-use_postprocessing_threshold"
name="settings-general-use_postprocessing_threshold">
<span class="custom-control-label"
for="settings-general-use_postprocessing_threshold"></span>
</label> </label>
</div> </div>
</div> </div>
@ -291,7 +320,9 @@
<b>Only for score below</b> <b>Only for score below</b>
</div> </div>
<div class="col-sm-1"> <div class="col-sm-1">
<input type="number" class="form-control" id="settings-general-postprocessing_threshold" name="settings-general-postprocessing_threshold" min="0" max="100" step="1" onkeydown="return false" value="{{settings.general.postprocessing_threshold}}"> <input type="number" class="form-control" id="settings-general-postprocessing_threshold"
name="settings-general-postprocessing_threshold" min="0" max="100" step="1"
onkeydown="return false" value="{{ settings.general.postprocessing_threshold }}">
</div> </div>
</div> </div>
<br> <br>
@ -301,8 +332,11 @@
</div> </div>
<div class="col-sm-1"> <div class="col-sm-1">
<label class="custom-control custom-checkbox"> <label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="settings-general-use_postprocessing_threshold_movie" name="settings-general-use_postprocessing_threshold_movie"> <input type="checkbox" class="custom-control-input"
<span class="custom-control-label" for="settings-general-use_postprocessing_threshold_movie"></span> id="settings-general-use_postprocessing_threshold_movie"
name="settings-general-use_postprocessing_threshold_movie">
<span class="custom-control-label"
for="settings-general-use_postprocessing_threshold_movie"></span>
</label> </label>
</div> </div>
</div> </div>
@ -312,7 +346,9 @@
<b>Only for score below</b> <b>Only for score below</b>
</div> </div>
<div class="col-sm-1"> <div class="col-sm-1">
<input type="number" class="form-control" id="settings-general-postprocessing_threshold_movie" name="settings-general-postprocessing_threshold_movie" min="0" max="100" step="1" onkeydown="return false" value="{{settings.general.postprocessing_threshold_movie}}"> <input type="number" class="form-control" id="settings-general-postprocessing_threshold_movie"
name="settings-general-postprocessing_threshold_movie" min="0" max="100" step="1"
onkeydown="return false" value="{{ settings.general.postprocessing_threshold_movie }}">
</div> </div>
</div> </div>
<br> <br>
@ -321,7 +357,9 @@
<b>Post-processing command</b> <b>Post-processing command</b>
</div> </div>
<div class="col-sm-8"> <div class="col-sm-8">
<input type="text" class="form-control" id="settings-general-postprocessing_cmd" name="settings-general-postprocessing_cmd" value="{{settings.general.postprocessing_cmd}}"> <input type="text" class="form-control" id="settings-general-postprocessing_cmd"
name="settings-general-postprocessing_cmd"
value="{{ settings.general.postprocessing_cmd }}">
</div> </div>
</div> </div>
<br> <br>
@ -350,6 +388,8 @@
<p>The 2-letter ISO-639 language code of the episode audio language.</p> <p>The 2-letter ISO-639 language code of the episode audio language.</p>
<b>&lbrace;&lbrace;episode_language_code3&rbrace;&rbrace;</b> <b>&lbrace;&lbrace;episode_language_code3&rbrace;&rbrace;</b>
<p>The 3-letter ISO-639 language code of the episode audio language.</p> <p>The 3-letter ISO-639 language code of the episode audio language.</p>
<b>&lbrace;&lbrace;score&rbrace;&rbrace;</b>
<p>The score of the subtitles file.</p>
</div> </div>
</div> </div>
</div> </div>
@ -362,7 +402,7 @@
$(document).ready(function () { $(document).ready(function () {
// Show warning if there's unsaved changes in the settings_form // Show warning if there's unsaved changes in the settings_form
var form_changed = false; var form_changed = false;
$(window).on('beforeunload', function() { $(window).on('beforeunload', function () {
if (form_changed) { if (form_changed) {
return ""; return "";
} }
@ -373,7 +413,7 @@
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); $('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
// Hide *_div on Select input changed to None // Hide *_div on Select input changed to None
$('#settings-general-subfolder').on('change', function() { $('#settings-general-subfolder').on('change', function () {
if ($(this).val() === 'current') { if ($(this).val() === 'current') {
$('#subfolder_div').hide(); $('#subfolder_div').hide();
} else { } else {
@ -381,7 +421,7 @@
} }
}); });
$('#settings-general-upgrade_subs').on('change', function() { $('#settings-general-upgrade_subs').on('change', function () {
if ($(this).prop('checked')) { if ($(this).prop('checked')) {
$('#upgradesubs_div').show(); $('#upgradesubs_div').show();
} else { } else {
@ -389,7 +429,7 @@
} }
}); });
$('#settings-general-anti_captcha_provider').on('change', function() { $('#settings-general-anti_captcha_provider').on('change', function () {
if ($(this).val() === 'anti-captcha') { if ($(this).val() === 'anti-captcha') {
$('#anticaptcha_div').show(); $('#anticaptcha_div').show();
$('#deathbycaptcha_div').hide(); $('#deathbycaptcha_div').hide();
@ -402,7 +442,7 @@
} }
}); });
$('#settings-general-use_embedded_subs').on('change', function() { $('#settings-general-use_embedded_subs').on('change', function () {
if ($(this).prop('checked')) { if ($(this).prop('checked')) {
$('#embedded_div').show(); $('#embedded_div').show();
} else { } else {
@ -410,7 +450,7 @@
} }
}); });
$('#settings-general-chmod_enabled').on('change', function() { $('#settings-general-chmod_enabled').on('change', function () {
if ($(this).prop('checked')) { if ($(this).prop('checked')) {
$('#chmod_div').show(); $('#chmod_div').show();
} else { } else {
@ -418,7 +458,7 @@
} }
}); });
$('#settings-general-use_postprocessing').on('change', function() { $('#settings-general-use_postprocessing').on('change', function () {
if ($(this).prop('checked')) { if ($(this).prop('checked')) {
$('#custompp_div').show(); $('#custompp_div').show();
} else { } else {
@ -445,7 +485,7 @@
$('#settings-general-use_postprocessing_threshold').prop('checked', {{'true' if settings.general.getboolean('use_postprocessing_threshold') else 'false'}}).trigger('change'); $('#settings-general-use_postprocessing_threshold').prop('checked', {{'true' if settings.general.getboolean('use_postprocessing_threshold') else 'false'}}).trigger('change');
$('#settings-general-use_postprocessing_threshold_movie').prop('checked', {{'true' if settings.general.getboolean('use_postprocessing_threshold_movie') else 'false'}}).trigger('change'); $('#settings-general-use_postprocessing_threshold_movie').prop('checked', {{'true' if settings.general.getboolean('use_postprocessing_threshold_movie') else 'false'}}).trigger('change');
$('#save_button').on('click', function() { $('#save_button').on('click', function () {
var formdata = new FormData(document.getElementById("settings_form")); var formdata = new FormData(document.getElementById("settings_form"));
// Make sure all checkbox input are sent with true/false value // Make sure all checkbox input are sent with true/false value
@ -464,8 +504,7 @@
form_changed = false; form_changed = false;
$('#save_button').prop('disabled', true).css('cursor', 'not-allowed'); $('#save_button').prop('disabled', true).css('cursor', 'not-allowed');
setTimeout( setTimeout(
function() function () {
{
$('#save_button_checkmark').hide(); $('#save_button_checkmark').hide();
}, 2000); }, 2000);
} }
@ -473,7 +512,7 @@
}); });
// monitor changes to the settings_form // monitor changes to the settings_form
$('#settings_form').on('change', function() { $('#settings_form').on('change', function () {
form_changed = true; form_changed = true;
$('#save_button').prop('disabled', false).css('cursor', 'auto'); $('#save_button').prop('disabled', false).css('cursor', 'auto');
}) })

Loading…
Cancel
Save