-
Notifications
You must be signed in to change notification settings - Fork 0
Description
The bot preloads details and URLs for the entire requested playlist into memory prior to starting the music stream. This can lead to significant wait times between the request being made and the first track being played.
This can be improved by actually utilizing JS promises and asynchronously handling all the tracks after the first one. Currently, we synchronously handle each track.
Potential issues: the tracklist command and the initial 'Queued up <track #1> and <#> others' message can no longer guarantee that all the tracks are loaded in. Something like a loading flag or lock will have to be implemented to allow those messages to be sent after all tracks are loaded.
Alternatively, this could also be managed by changing how the track info is stored. If more of the download setup is done immediately prior to the track starting, then this greatly reduces the work needed at request-time. However, this would add latency between tracks that may be comparatively worse for UX.