Merge pull request #1028 from MikoGome/order-audio
Some checks failed
auto-documentation / documentation (push) Has been cancelled
build and push docker image / build-node (push) Has been cancelled
Style and build test / eslint (push) Has been cancelled
Style and build test / test (push) Has been cancelled

order audio tracks based on --dubLang
This commit is contained in:
Stratuma 2025-08-24 18:04:15 +02:00 committed by GitHub
commit cf334d0bec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2687,6 +2687,11 @@ export default class Crunchy implements ServiceClass {
item.langs.push(langsData.languages.find(a => a.cr_locale == version.audio_locale) as langsData.LanguageItem);
}
}
//Sort audio tracks according to the order of languages passed to the 'dubLang' option
const argv = yargs.appArgv(this.cfg.cli);
if(!argv.allDubs) {
item.langs.sort((a,b) => argv.dubLang.indexOf(a.code) - argv.dubLang.indexOf(b.code));
}
} else {
//Episode didn't have versions, mark it as such to be logged.
serieshasversions = false;