From dbfd577a2d4f76499c1a24ddd03a2963697dc764 Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Thu, 28 Dec 2023 00:04:55 -0500 Subject: [PATCH] Added UI to choose which providers to exclude from sync process. --- bazarr/app/config.py | 9 +++++++-- frontend/src/pages/Settings/Subtitles/index.tsx | 9 +++++++++ frontend/src/pages/Settings/Subtitles/options.ts | 8 ++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/bazarr/app/config.py b/bazarr/app/config.py index ecda2829b..00cded309 100644 --- a/bazarr/app/config.py +++ b/bazarr/app/config.py @@ -402,7 +402,9 @@ array_keys = ['excluded_tags', 'enabled_providers', 'path_mappings', 'path_mappings_movie', - 'language_equals'] + 'language_equals', + 'blacklisted_languages', + 'blacklisted_providers'] empty_values = ['', 'None', 'null', 'undefined', None, []] @@ -630,7 +632,10 @@ def save_settings(settings_items): reset_throttled_providers(only_auth_or_conf_error=True) if settings_keys[0] == 'settings': - settings[settings_keys[1]][settings_keys[2]] = value + if len(settings_keys) == 3: + settings[settings_keys[1]][settings_keys[2]] = value + elif len(settings_keys) == 4: + settings[settings_keys[1]][settings_keys[2]][settings_keys[3]] = value if settings_keys[0] == 'subzero': mod = settings_keys[1] diff --git a/frontend/src/pages/Settings/Subtitles/index.tsx b/frontend/src/pages/Settings/Subtitles/index.tsx index 0d0337201..ee0dda2ce 100644 --- a/frontend/src/pages/Settings/Subtitles/index.tsx +++ b/frontend/src/pages/Settings/Subtitles/index.tsx @@ -5,6 +5,7 @@ import { CollapseBox, Layout, Message, + MultiSelector, Password, Section, Selector, @@ -23,6 +24,7 @@ import { embeddedSubtitlesParserOption, folderOptions, hiExtensionOptions, + providerOptions, } from "./options"; interface CommandOption { @@ -405,6 +407,13 @@ const SettingsSubtitlesView: FunctionComponent = () => { subtitles. + Do not actually sync the subtitles but generate a .tar.gz file to be diff --git a/frontend/src/pages/Settings/Subtitles/options.ts b/frontend/src/pages/Settings/Subtitles/options.ts index 62c4f60b2..2c57584fe 100644 --- a/frontend/src/pages/Settings/Subtitles/options.ts +++ b/frontend/src/pages/Settings/Subtitles/options.ts @@ -1,4 +1,5 @@ import { SelectorOption } from "@/components"; +import { ProviderList } from "../Providers/list"; export const hiExtensionOptions: SelectorOption[] = [ { @@ -165,3 +166,10 @@ export const colorOptions: SelectorOption[] = [ value: buildColor("dark-grey"), }, ]; + +export const providerOptions: SelectorOption[] = ProviderList.map( + (v) => ({ + label: v.key, + value: v.key, + }) +);