diff --git a/src/parser/ytmusic/Playlist.ts b/src/parser/ytmusic/Playlist.ts index ebfd9a16..8cb92773 100644 --- a/src/parser/ytmusic/Playlist.ts +++ b/src/parser/ytmusic/Playlist.ts @@ -140,6 +140,10 @@ class Playlist { return this.#page; } + get items(): ObservedArray { + return this.contents || observe([]); + } + get has_continuation(): boolean { return !!this.#continuation; } diff --git a/test/main.test.ts b/test/main.test.ts index 388453b3..c2b4f793 100644 --- a/test/main.test.ts +++ b/test/main.test.ts @@ -381,8 +381,8 @@ describe('YouTube.js Tests', () => { const playlist = await innertube.music.getPlaylist('PLQxo8OvVvJ1WI_Bp67F2wdIl_R2Rc_1-u'); expect(playlist).toBeDefined(); expect(playlist.header).toBeDefined(); - expect(playlist.items).toBeDefined(); - expect(playlist.items?.length).toBeGreaterThan(0); + expect(playlist.contents).toBeDefined(); + expect(playlist.contents?.length).toBeGreaterThan(0); }); test('Innertube#music.getLyrics', async () => {