aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/pages/Settings/Languages/index.tsx
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2023-02-09 16:58:38 -0500
committermorpheus65535 <[email protected]>2023-02-09 16:58:38 -0500
commit3310f6aeb88fcc9a70f9e5d6f673873ff2f1af85 (patch)
treec178ea1e9630161fb0af1161f126cd9272bd1834 /frontend/src/pages/Settings/Languages/index.tsx
parent7f05f932ffb84ba8b9e5630b2adc34dbd77e2b4a (diff)
downloadbazarr-3310f6aeb88fcc9a70f9e5d6f673873ff2f1af85.tar.gz
bazarr-3310f6aeb88fcc9a70f9e5d6f673873ff2f1af85.zip
Improved audio track language detection by using our video parser instead of values provided by Sonarr/Radarr. We also added "treat as" concept for undefined languages audio and embedded subtitles tracks. #2050v1.1.5-beta.13
Diffstat (limited to 'frontend/src/pages/Settings/Languages/index.tsx')
-rw-r--r--frontend/src/pages/Settings/Languages/index.tsx46
1 files changed, 44 insertions, 2 deletions
diff --git a/frontend/src/pages/Settings/Languages/index.tsx b/frontend/src/pages/Settings/Languages/index.tsx
index 726992916..4616ab1ab 100644
--- a/frontend/src/pages/Settings/Languages/index.tsx
+++ b/frontend/src/pages/Settings/Languages/index.tsx
@@ -1,8 +1,20 @@
import { useLanguageProfiles, useLanguages } from "@/apis/hooks";
import { useEnabledLanguages } from "@/utilities/languages";
import { FunctionComponent } from "react";
-import { Check, CollapseBox, Layout, Message, Section } from "../components";
-import { enabledLanguageKey, languageProfileKey } from "../keys";
+import {
+ Check,
+ CollapseBox,
+ Layout,
+ Message,
+ Section,
+ Selector,
+} from "../components";
+import {
+ defaultUndAudioLang,
+ defaultUndEmbeddedSubtitlesLang,
+ enabledLanguageKey,
+ languageProfileKey,
+} from "../keys";
import { useSettingValue } from "../utilities/hooks";
import { LanguageSelector, ProfileSelector } from "./components";
import Table from "./table";
@@ -31,6 +43,8 @@ export function useLatestProfiles() {
const SettingsLanguagesView: FunctionComponent = () => {
const { data: languages } = useLanguages();
+ const { data: und_audio_languages } = useEnabledLanguages();
+ const { data: und_embedded_subtitles_languages } = useEnabledLanguages();
return (
<Layout name="Languages">
<Section header="Subtitles Language">
@@ -54,6 +68,34 @@ const SettingsLanguagesView: FunctionComponent = () => {
options={languages ?? []}
></LanguageSelector>
</Section>
+
+ <Section header="Default Unknown Track Language">
+ <Selector
+ clearable
+ settingKey={defaultUndAudioLang}
+ label="Treat unknown language audio track as (changing this will trigger missing subtitles calculation)"
+ placeholder="Select languages"
+ options={und_audio_languages.map((v) => {
+ return { label: v.name, value: v.code2 };
+ })}
+ settingOptions={{
+ onSubmit: (v) => (v === null ? "" : v),
+ }}
+ ></Selector>
+
+ <Selector
+ clearable
+ settingKey={defaultUndEmbeddedSubtitlesLang}
+ label="Treat unknown language embedded subtitles track as (changing this will trigger full subtitles indexation using cache)"
+ placeholder="Select languages"
+ options={und_embedded_subtitles_languages.map((v) => {
+ return { label: v.name, value: v.code2 };
+ })}
+ settingOptions={{
+ onSubmit: (v) => (v === null ? "" : v),
+ }}
+ ></Selector>
+ </Section>
<Section header="Languages Profiles">
<Table></Table>
</Section>