From e70dd907fd54ce2b9091713490579ca1f8ea034f Mon Sep 17 00:00:00 2001 From: MikoGome Date: Mon, 18 Aug 2025 05:54:05 -0700 Subject: [PATCH] order audio tracks based on --dubLang --- crunchy.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crunchy.ts b/crunchy.ts index f29b061..a61e536 100644 --- a/crunchy.ts +++ b/crunchy.ts @@ -2683,6 +2683,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;