Skip to content

Commit

Permalink
chore(Playlist): Add MusicResponsiveHeader to header types
Browse files Browse the repository at this point in the history
Oops! I forgot this one also existed : ).
  • Loading branch information
LuanRT committed Jun 22, 2024
1 parent fe95307 commit d6fa134
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/parser/ytmusic/Playlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import MusicPlaylistShelf from '../classes/MusicPlaylistShelf.js';
import MusicShelf from '../classes/MusicShelf.js';
import SectionList from '../classes/SectionList.js';
import MusicResponsiveListItem from '../classes/MusicResponsiveListItem.js';
import MusicResponsiveHeader from '../classes/MusicResponsiveHeader.js';

import { InnertubeError } from '../../utils/Utils.js';
import { observe, type ObservedArray } from '../helpers.js';
Expand All @@ -21,7 +22,7 @@ class Playlist {
#last_fetched_suggestions: ObservedArray<MusicResponsiveListItem> | null;
#suggestions_continuation: string | null;

header?: MusicDetailHeader | MusicEditablePlaylistDetailHeader;
header?: MusicResponsiveHeader | MusicDetailHeader | MusicEditablePlaylistDetailHeader;
contents?: ObservedArray<MusicResponsiveListItem>;
background?: MusicThumbnail;

Expand All @@ -41,7 +42,7 @@ class Playlist {
} else {
if (!this.#page.contents_memo)
throw new InnertubeError('No contents found in the response');
this.header = this.#page.contents_memo.getType(MusicEditablePlaylistDetailHeader, MusicDetailHeader)?.first();
this.header = this.#page.contents_memo.getType(MusicResponsiveHeader, MusicEditablePlaylistDetailHeader, MusicDetailHeader)?.first();
this.contents = this.#page.contents_memo.getType(MusicPlaylistShelf)?.first()?.contents || observe([]);
this.background = this.#page.background;
this.#continuation = this.#page.contents_memo.getType(MusicPlaylistShelf)?.first()?.continuation || null;
Expand Down

0 comments on commit d6fa134

Please sign in to comment.