refactor(Playlist): Ignore ContinuationItem nodes from SectionList#contents (#579)

* feat(PlaylistVideo): Add `style`

* refactor(Playlist): Ignore `ContinuationItem` nodes in `SectionList#contents`

This should fix some issues regarding the library fetching the wrong continuation or empty continuations (NOTE: This means the solution in 987f506 no longer applies as empty continuations were all in `SectionList#contents`).
This commit is contained in:
Luan
2024-01-18 14:39:25 -03:00
committed by GitHub
parent 6082b4a52e
commit 04d55d04c7
2 changed files with 41 additions and 3 deletions

View File

@@ -23,6 +23,7 @@ export default class PlaylistVideo extends YTNode {
upcoming?: Date;
video_info: Text;
accessibility_label?: string;
style?: string;
duration: {
text: string;
@@ -44,6 +45,10 @@ export default class PlaylistVideo extends YTNode {
this.video_info = new Text(data.videoInfo);
this.accessibility_label = data.title.accessibility.accessibilityData.label;
if (Reflect.has(data, 'style')) {
this.style = data.style;
}
const upcoming = data.upcomingEventData && Number(`${data.upcomingEventData.startTime}000`);
if (upcoming) {
this.upcoming = new Date(upcoming);