RikiBorders / Goose

A responsive multi-purpose Discord Bot
0 stars 0 forks source link

[System Refactor] Potentially Replace music queue download coroutine #7

Closed RikiBorders closed 1 year ago

RikiBorders commented 2 years ago

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.

RikiBorders commented 2 years 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.

RikiBorders commented 2 years ago

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.

RikiBorders commented 1 year ago

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.