mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-30 09:55:18 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user