mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-14 01:36:08 -07:00
Merge pull request #263 from townsste/master
Bug fix for Chinese orginal language
This commit is contained in:
commit
6a95bcd088
1 changed files with 7 additions and 10 deletions
|
|
@ -108,18 +108,15 @@ const processStreams = (result, file, user_langs) => {
|
||||||
};
|
};
|
||||||
let streamIndex = 0;
|
let streamIndex = 0;
|
||||||
|
|
||||||
const langsTemp = result.original_language;
|
// If the original language is pulled as Chinese 'cn' is used. iso-language expects 'zh' for Chinese.
|
||||||
|
const langsTemp = result.original_language === 'cn' ? 'zh' : result.original_language;
|
||||||
|
|
||||||
let langs = [];
|
let langs = [];
|
||||||
|
|
||||||
if (Array.isArray(langsTemp)) {
|
langs.push(languages.alpha2ToAlpha3B(langsTemp));
|
||||||
// For loop because I thought some imdb stuff returns multiple languages
|
|
||||||
// Translates 'en' to 'eng', because imdb uses a different format compared to ffmpeg
|
// Some console reporting for clarification of what the plugin is using and reporting.
|
||||||
for (let i = 0; i < langsTemp.length; i += 1) {
|
response.infoLog += `Original language: ${langsTemp}, Using code: ${languages.alpha2ToAlpha3B(langsTemp)}\n`;
|
||||||
langs.push(languages.alpha2ToAlpha3B(langsTemp));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
langs.push(languages.alpha2ToAlpha3B(langsTemp));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user_langs) {
|
if (user_langs) {
|
||||||
langs = langs.concat(user_langs);
|
langs = langs.concat(user_langs);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue