mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-02-24 23:07:36 +08:00
Fixed external subtitles not shown when no languages profile is selected.
This commit is contained in:
parent
ec199edefc
commit
fd6c959ec8
1 changed files with 12 additions and 6 deletions
|
@ -112,12 +112,18 @@ export function filterSubtitleBy(
|
||||||
subtitles: Subtitle[],
|
subtitles: Subtitle[],
|
||||||
languages: Language[]
|
languages: Language[]
|
||||||
): Subtitle[] {
|
): Subtitle[] {
|
||||||
const result = differenceWith(
|
if (languages.length === 0) {
|
||||||
subtitles,
|
return subtitles.filter((subtitle) => {
|
||||||
languages,
|
return subtitle.path !== null;
|
||||||
(a, b) => a.code2 === b.code2 || a.path !== null
|
});
|
||||||
);
|
} else {
|
||||||
return difference(subtitles, result);
|
const result = differenceWith(
|
||||||
|
subtitles,
|
||||||
|
languages,
|
||||||
|
(a, b) => a.code2 === b.code2 || a.path !== null || a.code2 === undefined
|
||||||
|
);
|
||||||
|
return difference(subtitles, result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export * from "./hooks";
|
export * from "./hooks";
|
||||||
|
|
Loading…
Reference in a new issue