Skip to content

Commit

Permalink
feat(Format): Add is_secondary for detecting secondary audio tracks (
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue authored Jul 24, 2024
1 parent 0f8f92a commit a352dde
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/parser/classes/misc/Format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a352dde

Please sign in to comment.