From d6f3583e05c5b093b343622d741d247e46487ef3 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:01:48 +0200 Subject: [PATCH] feat(Format): Add `is_secondary` for detecting secondary audio tracks --- src/parser/classes/misc/Format.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser/classes/misc/Format.ts b/src/parser/classes/misc/Format.ts index 9c199948b..58578e22f 100644 --- a/src/parser/classes/misc/Format.ts +++ b/src/parser/classes/misc/Format.ts @@ -57,6 +57,7 @@ export default class Format { language?: string | null; is_dubbed?: boolean; is_descriptive?: boolean; + is_secondary?: boolean; is_original?: boolean; color_info?: { primaries?: string; @@ -213,7 +214,8 @@ export default class Format { const audio_content = xtags?.find((x) => x.startsWith('acont='))?.split('=')[1]; this.is_dubbed = audio_content === 'dubbed'; this.is_descriptive = audio_content === 'descriptive'; - this.is_original = audio_content === 'original' || (!this.is_dubbed && !this.is_descriptive && !this.is_drc); + this.is_secondary = audio_content === 'secondary'; + this.is_original = audio_content === 'original' || (!this.is_dubbed && !this.is_descriptive && !this.is_secondary && !this.is_drc); } // Some text tracks don't have xtags while others do