mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-30 09:55:18 +00:00
@@ -1,19 +1,20 @@
|
||||
import { YTNode, type ObservedArray } from '../helpers.js';
|
||||
import { type ObservedArray, YTNode } from '../helpers.js';
|
||||
import { Parser, type RawNode } from '../index.js';
|
||||
import MusicResponsiveListItem from './MusicResponsiveListItem.js';
|
||||
import ContinuationItem from './ContinuationItem.js';
|
||||
|
||||
export default class MusicPlaylistShelf extends YTNode {
|
||||
static type = 'MusicPlaylistShelf';
|
||||
|
||||
playlist_id: string;
|
||||
contents: ObservedArray<MusicResponsiveListItem>;
|
||||
collapsed_item_count: number;
|
||||
continuation: string | null;
|
||||
public playlist_id: string;
|
||||
public contents: ObservedArray<MusicResponsiveListItem | ContinuationItem>;
|
||||
public collapsed_item_count: number;
|
||||
public continuation: string | null;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.playlist_id = data.playlistId;
|
||||
this.contents = Parser.parseArray(data.contents, MusicResponsiveListItem);
|
||||
this.contents = Parser.parseArray(data.contents, [ MusicResponsiveListItem, ContinuationItem ]);
|
||||
this.collapsed_item_count = data.collapsedItemCount;
|
||||
this.continuation = data.continuations?.[0]?.nextContinuationData?.continuation || null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user