feat(parser): add banner to PlaylistHeader (#337)

This commit is contained in:
Patrick Kan
2023-03-06 09:44:09 +08:00
committed by GitHub
parent 2cc7b8bcd6
commit 95033e723e
3 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import { YTNode } from '../helpers.js';
import NavigationEndpoint from './NavigationEndpoint.js';
import Thumbnail from './misc/Thumbnail.js';
class HeroPlaylistThumbnail extends YTNode {
static type = 'HeroPlaylistThumbnail';
thumbnails: Thumbnail[];
on_tap_endpoint: NavigationEndpoint;
constructor(data: any) {
super();
this.thumbnails = Thumbnail.fromResponse(data.thumbnail);
this.on_tap_endpoint = new NavigationEndpoint(data.onTap);
}
}
export default HeroPlaylistThumbnail;

View File

@@ -21,6 +21,7 @@ class PlaylistHeader extends YTNode {
save_button;
shuffle_play_button;
menu;
banner;
constructor(data: any) {
super();
@@ -39,6 +40,7 @@ class PlaylistHeader extends YTNode {
this.save_button = Parser.parse(data.saveButton);
this.shuffle_play_button = Parser.parse(data.shufflePlayButton);
this.menu = Parser.parse(data.moreActionsMenu);
this.banner = Parser.parseItem(data.playlistHeaderBanner);
}
}