diff options
author | morpheus65535 <[email protected]> | 2021-06-17 10:20:34 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2021-06-17 10:20:34 -0400 |
commit | fd6c959ec8baed6a13619f0df5ab404e6dd99b61 (patch) | |
tree | 0be7fae9b1cf7228b4dc1930c61420a88a7484a6 | |
parent | ec199edefc913d60353751660c4dfe81876d4674 (diff) | |
download | bazarr-fd6c959ec8baed6a13619f0df5ab404e6dd99b61.tar.gz bazarr-fd6c959ec8baed6a13619f0df5ab404e6dd99b61.zip |
Fixed external subtitles not shown when no languages profile is selected.v0.9.6-beta.28
-rw-r--r-- | frontend/src/utilites/index.ts | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/frontend/src/utilites/index.ts b/frontend/src/utilites/index.ts index 2bf8952f7..1e5376391 100644 --- a/frontend/src/utilites/index.ts +++ b/frontend/src/utilites/index.ts @@ -112,12 +112,18 @@ export function filterSubtitleBy( subtitles: Subtitle[], languages: Language[] ): Subtitle[] { - const result = differenceWith( - subtitles, - languages, - (a, b) => a.code2 === b.code2 || a.path !== null - ); - return difference(subtitles, result); + if (languages.length === 0) { + return subtitles.filter((subtitle) => { + return subtitle.path !== null; + }); + } else { + const result = differenceWith( + subtitles, + languages, + (a, b) => a.code2 === b.code2 || a.path !== null || a.code2 === undefined + ); + return difference(subtitles, result); + } } export * from "./hooks"; |