From a4ef2249ffbe14f5d5fa702b269dd0f61e14ada8 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Sat, 26 Oct 2024 22:54:12 +0200 Subject: [PATCH] feat: Support auto-dubbed audio tracks (#786) --- src/parser/classes/misc/Format.ts | 4 +++- src/utils/StreamingInfo.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/parser/classes/misc/Format.ts b/src/parser/classes/misc/Format.ts index 9bdbe2a8d..18457581b 100644 --- a/src/parser/classes/misc/Format.ts +++ b/src/parser/classes/misc/Format.ts @@ -57,6 +57,7 @@ export default class Format { has_text: boolean; language?: string | null; is_dubbed?: boolean; + is_auto_dubbed?: boolean; is_descriptive?: boolean; is_secondary?: boolean; is_original?: boolean; @@ -217,7 +218,8 @@ export default class Format { this.is_dubbed = audio_content === 'dubbed'; this.is_descriptive = audio_content === 'descriptive'; this.is_secondary = audio_content === 'secondary'; - this.is_original = audio_content === 'original' || (!this.is_dubbed && !this.is_descriptive && !this.is_secondary && !this.is_drc); + this.is_auto_dubbed = audio_content === 'dubbed-auto'; + this.is_original = audio_content === 'original' || (!this.is_dubbed && !this.is_descriptive && !this.is_secondary && !this.is_auto_dubbed && !this.is_drc); } // Some text tracks don't have xtags while others do diff --git a/src/utils/StreamingInfo.ts b/src/utils/StreamingInfo.ts index 5f09cdd1b..1d804cf39 100644 --- a/src/utils/StreamingInfo.ts +++ b/src/utils/StreamingInfo.ts @@ -428,7 +428,7 @@ function getTrackRoles(format: Format, has_drc_streams: boolean) { format.is_original ? 'main' : 'alternate' ]; - if (format.is_dubbed) + if (format.is_dubbed || format.is_auto_dubbed) roles.push('dub'); if (format.is_descriptive)