From 1b6c8297ddbc2856d942a44179d6852141bc9c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sat, 25 Apr 2020 08:23:22 -0400 Subject: [PATCH] WIP --- bazarr/config.py | 2 ++ views/settingslanguages.html | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bazarr/config.py b/bazarr/config.py index 8854185dd..90da5b9d9 100644 --- a/bazarr/config.py +++ b/bazarr/config.py @@ -153,12 +153,14 @@ base_url = settings.general.base_url def save_settings(settings_items): from database import database for key, value in settings_items: + # Intercept database stored settings if key == 'enabled_languages': database.execute("UPDATE table_settings_languages SET enabled=0") for item in value: database.execute("UPDATE table_settings_languages SET enabled=1 WHERE code2=?", (item,)) continue + # Make sure that text based form values aren't pass as list if isinstance(value, list) and len(value) == 1: value = value[0] diff --git a/views/settingslanguages.html b/views/settingslanguages.html index 1be303144..f9a7946b7 100644 --- a/views/settingslanguages.html +++ b/views/settingslanguages.html @@ -71,7 +71,9 @@
Languages
- +
+ +

@@ -134,9 +136,16 @@ // Hide *_div on Select input changed to None + $('#enabled_languages').on('change', function() { + //$('#settings-general-serie_default_language').selectpicker('val', $('#enabled_languages').val()); + console.log($('#enabled_languages').val()); + console.log($('#enabled_languages option:selected').text()); + }) + // 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'); + $('#settings-general-serie_default_language').val('{{settings.general.serie_default_language}}').trigger('change'); $('.selectpicker').selectpicker('refresh') // Set Checkbox input values