-
Notifications
You must be signed in to change notification settings - Fork 910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix playlist item fetching for local API #4102
Fix playlist item fetching for local API #4102
Conversation
For non dev to test this |
I'm curious why you decided to go with a callback instead of just returning all the results? |
Similar to I think in Ruby more than JS |
Mainly curious why you decided to use a callback, instead of collecting it in an array and returning it all in one go? |
videos.push(...parsedVideos) | ||
} | ||
const videos = [] | ||
await untilEndOfLocalPlayList(playlist, (p) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using promises and callbacks together is a weird code pattern, which I'm not a fan of (the whole point of async/await in javascript was to get away from callbacks), but as we are in a rush and the code works, i'll accept it this time.
* development: ! Fix playlist item fetching for local API (FreeTubeApp#4102) ! Fix watch page video published time parsing (FreeTubeApp#4105) Translated using Weblate (Serbian) Bump youtubei.js from 6.4.0 to 6.4.1 (FreeTubeApp#4090) Bump rimraf from 5.0.1 to 5.0.5 (FreeTubeApp#4091) Bump the stylelint group with 2 updates (FreeTubeApp#4088) Bump electron from 22.3.24 to 22.3.25 (FreeTubeApp#4089) Translated using Weblate (Bulgarian) Update FT history import to accept key lastViewedPlaylistId (FreeTubeApp#4038) Translated using Weblate (Dutch) Translated using Weblate (Lithuanian) Translated using Weblate (Japanese) Translated using Weblate (Croatian) Translated using Weblate (Estonian) Translated using Weblate (Croatian) # Conflicts: # src/renderer/components/data-settings/data-settings.js # src/renderer/components/ft-list-video/ft-list-video.js # src/renderer/components/watch-video-info/watch-video-info.js # src/renderer/views/Playlist/Playlist.js # src/renderer/views/Watch/Watch.js
* feature/playlist-2023-05: (176 commits) ! Fix playlist item fetching for local API (FreeTubeApp#4102) ! Fix watch page video published time parsing (FreeTubeApp#4105) Translated using Weblate (Serbian) Bump youtubei.js from 6.4.0 to 6.4.1 (FreeTubeApp#4090) Bump rimraf from 5.0.1 to 5.0.5 (FreeTubeApp#4091) Bump the stylelint group with 2 updates (FreeTubeApp#4088) Bump electron from 22.3.24 to 22.3.25 (FreeTubeApp#4089) Translated using Weblate (Bulgarian) Update FT history import to accept key lastViewedPlaylistId (FreeTubeApp#4038) ! Fix ft-video having different URLs in links Translated using Weblate (Dutch) Translated using Weblate (Lithuanian) Translated using Weblate (Japanese) Translated using Weblate (Croatian) Translated using Weblate (Estonian) Translated using Weblate (Croatian) ! Fix external player handling for video in local playlist Translated using Weblate (Finnish) Mobile/tablet channel page & share button visual improvements (FreeTubeApp#4061) Support multiple audio tracks and AV1 for Invidious by using the local API DASH manifest generator (FreeTubeApp#3942) ...
Pull Request Type
Related issue
Closes #4068 #4086
Description
YT now sometimes returns useless continuation data which makes loading "next page" sometimes failed with error from
youtube.js
We need to handle it somehow
Screenshots
Lazy
Testing
Example playlists/video with playlists to test
Watch video page, playlist component loading (normal)
Watch video page, playlist component loading (playlist cached)
Playlist view
Desktop
Additional context