aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend
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
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')
-rw-r--r--frontend/src/apis/hooks/system.ts5
-rw-r--r--frontend/src/pages/Series/index.tsx8
-rw-r--r--frontend/src/pages/Settings/Languages/index.tsx46
-rw-r--r--frontend/src/pages/Settings/keys.ts3
4 files changed, 52 insertions, 10 deletions
diff --git a/frontend/src/apis/hooks/system.ts b/frontend/src/apis/hooks/system.ts
index 24691c4b6..9be28c4d2 100644
--- a/frontend/src/apis/hooks/system.ts
+++ b/frontend/src/apis/hooks/system.ts
@@ -49,6 +49,11 @@ export function useSettingsMutation() {
{
onSuccess: () => {
client.invalidateQueries([QueryKeys.System]);
+ client.invalidateQueries([QueryKeys.Series]);
+ client.invalidateQueries([QueryKeys.Episodes]);
+ client.invalidateQueries([QueryKeys.Movies]);
+ client.invalidateQueries([QueryKeys.Wanted]);
+ client.invalidateQueries([QueryKeys.Badges]);
},
}
);
diff --git a/frontend/src/pages/Series/index.tsx b/frontend/src/pages/Series/index.tsx
index 6dfe07230..da20c4459 100644
--- a/frontend/src/pages/Series/index.tsx
+++ b/frontend/src/pages/Series/index.tsx
@@ -1,6 +1,5 @@
import { useSeriesModification, useSeriesPagination } from "@/apis/hooks";
import { Action } from "@/components";
-import { AudioList } from "@/components/bazarr";
import LanguageProfileName from "@/components/bazarr/LanguageProfile";
import { ItemEditModal } from "@/components/forms/ItemEditForm";
import { useModals } from "@/modules/modals";
@@ -45,13 +44,6 @@ const SeriesView: FunctionComponent = () => {
},
},
{
- Header: "Audio",
- accessor: "audio_language",
- Cell: ({ value }) => {
- return <AudioList audios={value}></AudioList>;
- },
- },
- {
Header: "Languages Profile",
accessor: "profileId",
Cell: ({ value }) => {
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>
diff --git a/frontend/src/pages/Settings/keys.ts b/frontend/src/pages/Settings/keys.ts
index a8ab17a5b..40b6a252d 100644
--- a/frontend/src/pages/Settings/keys.ts
+++ b/frontend/src/pages/Settings/keys.ts
@@ -1,4 +1,7 @@
export const enabledLanguageKey = "languages-enabled";
+export const defaultUndAudioLang = "settings-general-default_und_audio_lang";
+export const defaultUndEmbeddedSubtitlesLang =
+ "settings-general-default_und_embedded_subtitles_lang";
export const languageProfileKey = "languages-profiles";
export const notificationsKey = "notifications-providers";