Skip to content

Commit

Permalink
fix(VideoAttributeView): Parse secondarySubtitle only if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanRT committed Nov 9, 2024
1 parent e4ca991 commit 0a99342
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/parser/classes/VideoAttributeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class VideoAttributeView extends YTNode {
image_style: string;
title: string;
subtitle: string;
secondary_subtitle: {
secondary_subtitle?: {
content: string
};
orientation: string;
Expand All @@ -34,9 +34,13 @@ export default class VideoAttributeView extends YTNode {
this.image_style = data.imageStyle;
this.title = data.title;
this.subtitle = data.subtitle;
this.secondary_subtitle = {
content: data.secondarySubtitle.content
};

if (Reflect.has(data, 'secondarySubtitle')) {
this.secondary_subtitle = {
content: data.secondarySubtitle.content
};
}

this.orientation = data.orientation;
this.sizing_rule = data.sizingRule;
this.overflow_menu_on_tap = new NavigationEndpoint(data.overflowMenuOnTap);
Expand Down

0 comments on commit 0a99342

Please sign in to comment.