Files
YouTube.js/src/parser/classes/MusicShelf.js
2022-07-21 03:51:28 -03:00

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;