Skip to content

Commit

Permalink
refactor(VideoInfo): simplify watch next feed extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanRT committed Jan 6, 2023
1 parent 55ca986 commit d36389c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser/youtube/VideoInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class VideoInfo {
this.merchandise = results.firstOfType(MerchandiseShelf);
this.related_chip_cloud = secondary_results.firstOfType(RelatedChipCloud)?.content.item().as(ChipCloud);

this.watch_next_feed = actions.session.logged_in ? secondary_results.firstOfType(ItemSection)?.contents : secondary_results;
this.watch_next_feed = secondary_results.firstOfType(ItemSection)?.contents || secondary_results;

if (this.watch_next_feed && Array.isArray(this.watch_next_feed))
this.#watch_next_continuation = this.watch_next_feed.pop()?.as(ContinuationItem);
Expand Down

0 comments on commit d36389c

Please sign in to comment.