mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-28 09:06:51 +00:00
24 lines
739 B
JavaScript
24 lines
739 B
JavaScript
'use strict';
|
|
|
|
const Parser = require('..');
|
|
const Text = require('./Text');
|
|
const NavigationEndpoint = require('./NavigationEndpoint');
|
|
|
|
class MusicShelf {
|
|
type = 'musicShelfRenderer';
|
|
|
|
constructor(data) {
|
|
this.title = new Text(data.title);
|
|
|
|
this.contents = Parser.parse(data.contents, {
|
|
is_single_shelf: (!data.bottomEndpoint && this.title.toString() !== 'Top result'),
|
|
shelf_title: this.title
|
|
});
|
|
|
|
this.endpoint = data.bottomEndpoint && new NavigationEndpoint(data.bottomEndpoint) || null;
|
|
this.continuation = data.continuations?.[0].nextContinuationData.continuation || null;
|
|
this.bottom_text = data.bottomText && new Text(data.bottomText) || null;
|
|
}
|
|
}
|
|
|
|
module.exports = MusicShelf; |