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:
@@ -1,3 +1,4 @@
|
||||
import asyncio
|
||||
from collections import namedtuple
|
||||
from typing import List, MutableMapping, Optional, Union, TYPE_CHECKING
|
||||
|
||||
@@ -478,12 +479,16 @@ async def get_all_playlist(
|
||||
playlists = await database.fetch_all(scope_standard, scope_id, author_id=user_id)
|
||||
else:
|
||||
playlists = await database.fetch_all(scope_standard, scope_id)
|
||||
return [
|
||||
await Playlist.from_json(
|
||||
bot, scope, playlist.playlist_id, playlist, guild=guild, author=author
|
||||
|
||||
playlist_list = []
|
||||
for playlist in playlists:
|
||||
playlist_list.append(
|
||||
await Playlist.from_json(
|
||||
bot, scope, playlist.playlist_id, playlist, guild=guild, author=author
|
||||
)
|
||||
)
|
||||
for playlist in playlists
|
||||
]
|
||||
await asyncio.sleep(0)
|
||||
return playlist_list
|
||||
|
||||
|
||||
async def get_all_playlist_converter(
|
||||
@@ -524,12 +529,15 @@ async def get_all_playlist_converter(
|
||||
playlists = await database.fetch_all_converter(
|
||||
scope_standard, playlist_name=arg, playlist_id=arg
|
||||
)
|
||||
return [
|
||||
await Playlist.from_json(
|
||||
bot, scope, playlist.playlist_id, playlist, guild=guild, author=author
|
||||
playlist_list = []
|
||||
for playlist in playlists:
|
||||
playlist_list.append(
|
||||
await Playlist.from_json(
|
||||
bot, scope, playlist.playlist_id, playlist, guild=guild, author=author
|
||||
)
|
||||
)
|
||||
for playlist in playlists
|
||||
]
|
||||
await asyncio.sleep(0)
|
||||
return playlist_list
|
||||
|
||||
|
||||
async def create_playlist(
|
||||
|
||||
Reference in New Issue
Block a user