mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-03 09:35:05 +00:00
feat(Music): Add continuation support for "Up next" tab in TrackInfo (#770)
* chore: tests for playlist panel * chore: add possibility to continue music playlist panel * chore: allow further playlist continuation * revert: further revert Music.ts changes * chore: rename test description * chore: add check and remove TODO * fix: fix issue with new code * chore: remove documentation * fix: fix test by using some video from homepage
This commit is contained in:
@@ -337,6 +337,27 @@ describe('YouTube.js Tests', () => {
|
||||
expect(upNext.playlist_id).toBe("PLQxo8OvVvJ1WI_Bp67F2wdIl_R2Rc_1-u");
|
||||
});
|
||||
|
||||
test('Innertube#music.getInfo.NavEndpoint.getUpNextContinuation', async () => {
|
||||
// Fetch some video from Homepage
|
||||
const home = await innertube.music.getHomeFeed()
|
||||
const homeItemFirst = home.sections!.first().as(YTNodes.MusicCarouselShelf).contents[0].as(YTNodes.MusicResponsiveListItem)
|
||||
|
||||
const info = await innertube.music.getInfo(homeItemFirst.id ?? homeItemFirst.endpoint!)
|
||||
expect(info).toBeDefined();
|
||||
|
||||
const upNext = await info.getUpNext();
|
||||
|
||||
const endpoint = upNext.contents.filterType(YTNodes.PlaylistPanelVideo)[1].endpoint;
|
||||
|
||||
const info2 = await innertube.music.getInfo(endpoint)
|
||||
const upNext2 = await info2.getUpNextContinuation(upNext)
|
||||
expect(upNext2.contents?.length).toBeGreaterThan(0);
|
||||
|
||||
const upNext3 = await info2.getUpNextContinuation(upNext2)
|
||||
expect(upNext3.contents?.length).toBeGreaterThan(0);
|
||||
|
||||
});
|
||||
|
||||
describe('Innertube#music.search', () => {
|
||||
let search: YTMusic.Search;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user