mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 20:41:17 +00:00
29 lines
726 B
JavaScript
29 lines
726 B
JavaScript
import Parser from '../index';
|
|
import Text from './misc/Text';
|
|
import NavigationEndpoint from './NavigationEndpoint';
|
|
import { YTNode } from '../helpers';
|
|
|
|
class MusicShelf extends YTNode {
|
|
static type = 'MusicShelf';
|
|
|
|
constructor(data) {
|
|
super();
|
|
this.title = new Text(data.title).toString();
|
|
this.contents = Parser.parse(data.contents);
|
|
|
|
if (data.bottomEndpoint) {
|
|
this.endpoint = new NavigationEndpoint(data.bottomEndpoint);
|
|
}
|
|
|
|
if (data.continuations) {
|
|
// TODO: type this
|
|
this.continuation = data.continuations?.[0].nextContinuationData.continuation;
|
|
}
|
|
|
|
if (data.bottomText) {
|
|
this.bottom_text = new Text(data.bottomText);
|
|
}
|
|
}
|
|
}
|
|
|
|
export default MusicShelf; |