mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-23 11:13:51 -05:00
[3.2]Audio] some hotfixes to avoid crashing the bot (#3286)
* Add a command to toggle daily queues, and restrict playlist length to 10k tracks and try to avoid some blocking calls Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * Add a command to toggle daily queues, and restrict playlist length to 10k tracks and try to avoid some blocking calls Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * indents Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * *sigh* forgot single tracks Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * formatting plus some other fixes Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * formatting plus some other fixes Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
This commit is contained in:
@@ -318,6 +318,7 @@ class MusicCache:
|
||||
youtube_urls.append(val)
|
||||
else:
|
||||
youtube_urls.append(track_info)
|
||||
await asyncio.sleep(0)
|
||||
track_count += 1
|
||||
if notifier and ((track_count % 2 == 0) or (track_count == total_tracks)):
|
||||
await notifier.notify_user(current=track_count, total=total_tracks, key="youtube")
|
||||
@@ -615,6 +616,8 @@ class MusicCache:
|
||||
continue
|
||||
track_list.append(single_track)
|
||||
if enqueue:
|
||||
if len(player.queue) >= 10000:
|
||||
continue
|
||||
if guild_data["maxlength"] > 0:
|
||||
if track_limit(single_track, guild_data["maxlength"]):
|
||||
enqueued_tracks += 1
|
||||
|
||||
Reference in New Issue
Block a user