Closed RikiBorders closed 1 year ago
This must be implemented/refactored. It makes no sense to preload songs when they could very well be skipped or removed from the queue at some point.
If we download videos on demand, then we fix the issue of needless preloading, remove an unnecessary coroutine, and speed up queue population and usage drastically.
This isn't high priority right now as other smaller features could be implemented in the meantime, but this change should be done by the end of the month.
Additional trade-off: If we downlaod videos on-demand, then we can only display limited information in the queue. Things like video length are fetched via the downloaded meta_data.
Tbh we can't get metadata like duration without downloading the video, so we'll leave the queue working as it is. If someone adds a ridiculously large playlist, then they can just clear the queue to get around waiting forever. Thats on top of the skip tool as well.
This is a major refactor that will simplify the bot. Currently, we download songs at increments as part of a coroutine and store them in the queue. This allows for songs to be quickly played when the previous song is completed, but downloading the songs takes a long time. Instead, we can download songs/videos 'on demand', where the song is downloaded when it's the song's turn to be played. We can then store songs in the download queue as just links, which allows for queue management to be much faster.