mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-28 00:56:23 +00:00
fix(ytmusic): rename old class types
This commit is contained in:
@@ -8,9 +8,14 @@ class SectionList {
|
||||
constructor(data) {
|
||||
this.target_id = data.targetId || null;
|
||||
this.contents = Parser.parse(data.contents);
|
||||
|
||||
data.continuations &&
|
||||
(this.continuation = data.continuations[0].nextContinuationData.continuation);
|
||||
|
||||
if (data.continuations) {
|
||||
if (data.continuations[0].nextContinuationData) {
|
||||
this.continuation = data.continuations[0].nextContinuationData.continuation;
|
||||
} else if (data.continuations[0].reloadContinuationData) {
|
||||
this.continuation = data.continuations[0].reloadContinuationData.continuation;
|
||||
}
|
||||
}
|
||||
|
||||
this.header = Parser.parse(data.header);
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ class Library {
|
||||
const tab = this.#page.contents.tabs.get({ selected: true });
|
||||
const shelves = tab.content.contents.map((section) => section.contents[0]);
|
||||
|
||||
const stats = this.#page.contents.secondary_contents.items.get({ type: 'profileColumnStatsRenderer' }).items;
|
||||
const user_info = this.#page.contents.secondary_contents.items.get({ type: 'profileColumnUserInfoRenderer' });
|
||||
const stats = this.#page.contents.secondary_contents.items.get({ type: 'ProfileColumnStats' }).items;
|
||||
const user_info = this.#page.contents.secondary_contents.items.get({ type: 'ProfileColumnUserInfo' });
|
||||
|
||||
this.profile = { stats, user_info };
|
||||
|
||||
|
||||
@@ -28,24 +28,24 @@ class Search {
|
||||
const tab = this.#page.contents.tabs.get({ selected: true });
|
||||
const shelves = tab.content.contents;
|
||||
|
||||
const item_section = shelves.get({ type: 'itemSectionRenderer' });
|
||||
const item_section = shelves.get({ type: 'ItemSection' });
|
||||
|
||||
this.#header = tab.content.header;
|
||||
|
||||
/**
|
||||
* @type {import('../contents/classes/DidYouMean')}
|
||||
*/
|
||||
this.did_you_mean = item_section?.contents.get({ type: 'didYouMeanRenderer' }) || null;
|
||||
this.did_you_mean = item_section?.contents.get({ type: 'DidYouMean' }) || null;
|
||||
|
||||
/**
|
||||
* @type {import('../contents/classes/ShowingResultsFor')}
|
||||
*/
|
||||
this.showing_results_for = item_section?.contents.get({ type: 'showingResultsForRenderer' }) || null;
|
||||
this.showing_results_for = item_section?.contents.get({ type: 'ShowingResultsFor' }) || null;
|
||||
|
||||
(!!this.did_you_mean || !!this.showing_results_for) && shelves.shift();
|
||||
|
||||
if (args.is_continuation || args.is_filtered) {
|
||||
const shelf = shelves.get({ type: 'musicShelfRenderer' });
|
||||
const shelf = shelves.get({ type: 'MusicShelf' });
|
||||
|
||||
this.results = shelf.contents;
|
||||
this.#shelf_title = shelf.title.toString();
|
||||
|
||||
Reference in New Issue
Block a user