Pass playlist data from playlist page to watch page #2970
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pass playlist data from playlist page to watch page
Pull Request Type
Description
Currently when you start playling a video in a playlist from the playlist page, the watch page fetches the playlist information again. With this PR the watch page can reuse the playlist information that was already fetched on the playlist page, this prevents unnecessary network activity and also speeds up the loading of the playlist component on the watch page, as it has less to do. If the playlist has extra pages that haven't been fetched yet, the watch page will fetch those.
The watch page will of course still need to fetch everything itself if you come from a different page.
I also got rid of some unused properties, as I noticed them while implementing the changes mentioned above.
Testing
Single page playlist
https://www.youtube.com/playlist?list=PL4fGSI1pDJn6puJdseH2Rt9sMvt9E2M4i
Playlist with lots of pages
https://www.youtube.com/playlist?list=PLbMjU_TVMIFvmkQ871iUvE5gy5ezXc6hE
Desktop