From 898bdf95e426acd7a6705a32ac50cefa1e3c2f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Wed, 22 Apr 2020 22:29:59 -0400 Subject: [PATCH] WIP --- views/settingsgeneral.html | 8 +- views/settingsradarr.html | 6 +- views/settingssonarr.html | 6 +- views/settingssubtitles.html | 230 ++++++++++++++++++++++++++++++++++- 4 files changed, 238 insertions(+), 12 deletions(-) diff --git a/views/settingsgeneral.html b/views/settingsgeneral.html index 84e49be61..d61d5dc6c 100644 --- a/views/settingsgeneral.html +++ b/views/settingsgeneral.html @@ -321,10 +321,10 @@ $('.selectpicker').selectpicker('refresh') // Set Checkbox input values - $('#settings-general-debug').prop('checked', {{'true' if settings.general.getboolean('debug')}}); - $('#settings-analytics-enabled').prop('checked', {{'true' if settings.analytics.getboolean('enabled')}}); - $('#settings-general-auto_update').prop('checked', {{'true' if settings.general.getboolean('auto_update')}}); - $('#settings-general-update_restart').prop('checked', {{'true' if settings.general.getboolean('update_restart')}}); + $('#settings-general-debug').prop('checked', {{'true' if settings.general.getboolean('debug') else 'false'}}); + $('#settings-analytics-enabled').prop('checked', {{'true' if settings.analytics.getboolean('enabled') else 'false'}}); + $('#settings-general-auto_update').prop('checked', {{'true' if settings.general.getboolean('auto_update') else 'false'}}); + $('#settings-general-update_restart').prop('checked', {{'true' if settings.general.getboolean('update_restart') else 'false'}}); $('#save_button').on('click', function() { var formdata = new FormData(document.getElementById("settings_form")); diff --git a/views/settingsradarr.html b/views/settingsradarr.html index 331aaf9f3..7f1febaf6 100644 --- a/views/settingsradarr.html +++ b/views/settingsradarr.html @@ -256,9 +256,9 @@ }); // Set Checkbox input values - $('#settings-general-use_radarr').prop('checked', {{'true' if settings.general.getboolean('use_radarr')}}).trigger('change'); - $('#settings-radarr-ssl').prop('checked', {{'true' if settings.radarr.getboolean('ssl')}}); - $('#settings-radarr-only_monitored').prop('checked', {{'true' if settings.radarr.getboolean('only_monitored')}}); + $('#settings-general-use_radarr').prop('checked', {{'true' if settings.general.getboolean('use_radarr') else 'false'}}).trigger('change'); + $('#settings-radarr-ssl').prop('checked', {{'true' if settings.radarr.getboolean('ssl') else 'false'}}); + $('#settings-radarr-only_monitored').prop('checked', {{'true' if settings.radarr.getboolean('only_monitored') else 'false'}}); $('#save_button').on('click', function() { var formdata = new FormData(document.getElementById("settings_form")); diff --git a/views/settingssonarr.html b/views/settingssonarr.html index b242a4d51..a16210dc2 100644 --- a/views/settingssonarr.html +++ b/views/settingssonarr.html @@ -256,9 +256,9 @@ }); // Set Checkbox input values - $('#settings-general-use_sonarr').prop('checked', {{'true' if settings.general.getboolean('use_sonarr')}}).trigger('change'); - $('#settings-sonarr-ssl').prop('checked', {{'true' if settings.sonarr.getboolean('ssl')}}); - $('#settings-sonarr-only_monitored').prop('checked', {{'true' if settings.sonarr.getboolean('only_monitored')}}); + $('#settings-general-use_sonarr').prop('checked', {{'true' if settings.general.getboolean('use_sonarr') else 'false'}}).trigger('change'); + $('#settings-sonarr-ssl').prop('checked', {{'true' if settings.sonarr.getboolean('ssl') else 'false'}}); + $('#settings-sonarr-only_monitored').prop('checked', {{'true' if settings.sonarr.getboolean('only_monitored') else 'false'}}); $('#save_button').on('click', function() { var formdata = new FormData(document.getElementById("settings_form")); diff --git a/views/settingssubtitles.html b/views/settingssubtitles.html index c8ff8d39d..e92014b35 100644 --- a/views/settingssubtitles.html +++ b/views/settingssubtitles.html @@ -105,7 +105,189 @@ +
+
+
+ Provider Website +
+ +
+
+
+
+ Account Key +
+
+ +
+
+
+
+
+
+
+ Provider Website +
+ +
+
+
+
+ Username +
+
+ +
+
+
+
+
+ Password +
+
+ +
+
+
+
+

Performance / Optimization

+
+
+
+ Adaptive Searching +
+
+ +
+
+
+
+ Search Enabled Providers Simultaneously +
+
+ +
+
+
+
+ Use Embedded Subtitles +
+
+ +
+
+
+
+
+ Ignore Embedded PGS Subtitles +
+
+ +
+
+
+ +

Post-Processing

+
+
+
+ Encode Subtitles To UTF8 +
+
+ +
+
+
+
+ Enable CHMOD +
+
+ +
+
+
+
+
+ Set Subtitle file permissions to +
+
+ +
+
+
+
+
+
+ Use Custom Post-Processing +
+
+ +
+
+
+
+
+ Post-processing command +
+
+ +
+
+
+
+
+ Variables you can use in your command (include the double curly brace): +
+
+ {{directory}} +

The full path of the episode file parent directory.

+ {{episode}} +

The full path of the episode file.

+ {{episode_name}} +

The filename of the episode without parent directory or extension.

+ {{subtitles}} +

The full path of the subtitles file.

+ {{subtitles_language}} +

The language of the subtitles file.

+ {{subtitles_language_code2}} +

The 2-letter ISO-639 language code of the subtitles language.

+ {{subtitles_language_code3}} +

The 3-letter ISO-639 language code of the subtitles language.

+ {{episode_language}} +

The audio language of the episode file.

+ {{episode_language_code2}} +

The 2-letter ISO-639 language code of the episode audio language.

+ {{episode_language_code3}} +

The 3-letter ISO-639 language code of the episode audio language.

+
+
+
{% endblock body %} @@ -133,14 +315,58 @@ } }); + $('#settings-general-anti_captcha_provider').on('change', function() { + if ($(this).val() === 'anti-captcha') { + $('#anticaptcha_div').show(); + $('#deathbycaptcha_div').hide(); + } else if ($(this).val() === 'death-by-captcha') { + $('#anticaptcha_div').hide(); + $('#deathbycaptcha_div').show(); + } else { + $('#anticaptcha_div').hide(); + $('#deathbycaptcha_div').hide(); + } + }); + + $('#settings-general-use_embedded_subs').on('change', function() { + if ($(this).prop('checked')) { + $('#embedded_div').show(); + } else { + $('#embedded_div').hide(); + } + }); + + $('#settings-general-chmod_enabled').on('change', function() { + if ($(this).prop('checked')) { + $('#chmod_div').show(); + } else { + $('#chmod_div').hide(); + } + }); + + $('#settings-general-use_postprocessing').on('change', function() { + if ($(this).prop('checked')) { + $('#custompp_div').show(); + } else { + $('#custompp_div').hide(); + } + }); + // Set Select input values $('#settings-general-subfolder').val('{{settings.general.subfolder}}').trigger('change'); $('#settings-general-anti_captcha_provider').val('{{settings.general.anti_captcha_provider}}').trigger('change'); $('.selectpicker').selectpicker('refresh') // Set Checkbox input values - $('#settings-general-upgrade_subs').prop('checked', {{'true' if settings.general.getboolean('upgrade_subs')}}).trigger('change');; - $('#settings-general-upgrade_manual').prop('checked', {{'true' if settings.general.getboolean('upgrade_manual')}}).trigger('change');; + $('#settings-general-upgrade_subs').prop('checked', {{'true' if settings.general.getboolean('upgrade_subs') else 'false'}}).trigger('change'); + $('#settings-general-upgrade_manual').prop('checked', {{'true' if settings.general.getboolean('upgrade_manual') else 'false'}}).trigger('change'); + $('#settings-general-adaptive_searching').prop('checked', {{'true' if settings.general.getboolean('adaptive_searching') else 'false'}}).trigger('change'); + $('#settings-general-multithreading').prop('checked', {{'true' if settings.general.getboolean('multithreading') else 'false'}}).trigger('change'); + $('#settings-general-use_embedded_subs').prop('checked', {{'true' if settings.general.getboolean('use_embedded_subs') else 'false'}}).trigger('change'); + $('#settings-general-ignore_pgs_subs').prop('checked', {{'true' if settings.general.getboolean('ignore_pgs_subs') else 'false'}}).trigger('change'); + $('#settings-general-utf8_encode').prop('checked', {{'true' if settings.general.getboolean('utf8_encode') else 'false'}}).trigger('change'); + $('#settings-general-chmod_enabled').prop('checked', {{'true' if settings.general.getboolean('chmod_enabled') else 'false'}}).trigger('change'); + $('#settings-general-use_postprocessing').prop('checked', {{'true' if settings.general.getboolean('use_postprocessing') else 'false'}}).trigger('change'); $('#save_button').on('click', function() { var formdata = new FormData(document.getElementById("settings_form"));