-
-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(parser): add
MusicMultiRowListItem
Used to display podcasts.
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { YTNode } from "../helpers.js"; | ||
import { Parser, type RawNode } from "../index.js"; | ||
import { Text } from "../misc.js"; | ||
|
||
import Menu from "./menus/Menu.js"; | ||
import MusicItemThumbnailOverlay from "./MusicItemThumbnailOverlay.js"; | ||
import MusicThumbnail from "./MusicThumbnail.js"; | ||
import NavigationEndpoint from "./NavigationEndpoint.js"; | ||
|
||
export default class MusicMultiRowListItem extends YTNode { | ||
static type = 'MusicMultiRowListItem'; | ||
|
||
thumbnail: MusicThumbnail | null; | ||
overlay: MusicItemThumbnailOverlay | null; | ||
on_tap: NavigationEndpoint; | ||
menu: Menu | null; | ||
subtitle: Text; | ||
title: Text; | ||
second_title?: Text; | ||
description?: Text; | ||
display_style?: string; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
this.thumbnail = Parser.parseItem(data.thumbnail, MusicThumbnail); | ||
this.overlay = Parser.parseItem(data.overlay, MusicItemThumbnailOverlay); | ||
this.on_tap = new NavigationEndpoint(data.onTap); | ||
this.menu = Parser.parseItem(data.menu, Menu); | ||
this.subtitle = new Text(data.subtitle); | ||
this.title = new Text(data.title); | ||
|
||
if (Reflect.has(data, 'secondTitle')) { | ||
this.second_title = new Text(data.secondTitle); | ||
} | ||
|
||
if (Reflect.has(data, 'description')) { | ||
this.description = new Text(data.description); | ||
} | ||
|
||
if (Reflect.has(data, 'displayStyle')) { | ||
this.display_style = data.displayStyle; | ||
} | ||
} | ||
} |