mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-21 08:42:32 -05:00
Audio changes (#5593)
* Squash tested commits * remove the code jack is concerned about * Apply suggestions from code review * more log lines * more log lines * format * formatting * style(Rename Xms and Xmx mentions): Rename Xms and Xmx to more use friendly names - Change Xms to "Initial Heapsize" - Change Xmx to "Max Heapsize" Signed-off-by: Draper <27962761+Drapersniper@users.noreply.github.com>
This commit is contained in:
@@ -76,7 +76,7 @@ class GlobalCacheWrapper:
|
||||
) as r:
|
||||
search_response = await r.json(loads=json.loads)
|
||||
log.trace(
|
||||
"GET || Ping %s || Status code %d || %s",
|
||||
"GET || Ping %s || Status code %s || %s",
|
||||
r.headers.get("x-process-time"),
|
||||
r.status,
|
||||
query,
|
||||
@@ -107,7 +107,7 @@ class GlobalCacheWrapper:
|
||||
) as r:
|
||||
search_response = await r.json(loads=json.loads)
|
||||
log.trace(
|
||||
"GET/spotify || Ping %s || Status code %d || %s - %s",
|
||||
"GET/spotify || Ping %s || Status code %s || %s - %s",
|
||||
r.headers.get("x-process-time"),
|
||||
r.status,
|
||||
title,
|
||||
@@ -143,7 +143,7 @@ class GlobalCacheWrapper:
|
||||
) as r:
|
||||
await r.read()
|
||||
log.trace(
|
||||
"GET || Ping %s || Status code %d || %s",
|
||||
"GET || Ping %s || Status code %s || %s",
|
||||
r.headers.get("x-process-time"),
|
||||
r.status,
|
||||
query,
|
||||
|
||||
@@ -147,7 +147,7 @@ class AudioAPIInterface:
|
||||
lock_author = ctx.author if ctx else None
|
||||
async with self._lock:
|
||||
if lock_id in self._tasks:
|
||||
log.trace("Running database writes for %d (%s)", lock_id, lock_author)
|
||||
log.trace("Running database writes for %s (%s)", lock_id, lock_author)
|
||||
try:
|
||||
tasks = self._tasks[lock_id]
|
||||
tasks = [self.route_tasks(a, tasks[a]) for a in tasks]
|
||||
@@ -155,10 +155,10 @@ class AudioAPIInterface:
|
||||
del self._tasks[lock_id]
|
||||
except Exception as exc:
|
||||
log.verbose(
|
||||
"Failed database writes for %d (%s)", lock_id, lock_author, exc_info=exc
|
||||
"Failed database writes for %s (%s)", lock_id, lock_author, exc_info=exc
|
||||
)
|
||||
else:
|
||||
log.trace("Completed database writes for %d (%s)", lock_id, lock_author)
|
||||
log.trace("Completed database writes for %s (%s)", lock_id, lock_author)
|
||||
|
||||
async def run_all_pending_tasks(self) -> None:
|
||||
"""Run all pending tasks left in the cache, called on cog_unload."""
|
||||
@@ -618,7 +618,7 @@ class AudioAPIInterface:
|
||||
query_obj=query,
|
||||
):
|
||||
has_not_allowed = True
|
||||
log.debug("Query is not allowed in %r (%d)", ctx.guild.name, ctx.guild.id)
|
||||
log.debug("Query is not allowed in %r (%s)", ctx.guild.name, ctx.guild.id)
|
||||
continue
|
||||
track_list.append(single_track)
|
||||
if enqueue:
|
||||
@@ -973,7 +973,7 @@ class AudioAPIInterface:
|
||||
and not query.local_track_path.exists()
|
||||
):
|
||||
continue
|
||||
notify_channel = self.bot.get_channel(notify_channel_id)
|
||||
notify_channel = player.guild.get_channel(notify_channel_id)
|
||||
if not await self.cog.is_query_allowed(
|
||||
self.config,
|
||||
notify_channel,
|
||||
@@ -981,7 +981,7 @@ class AudioAPIInterface:
|
||||
query_obj=query,
|
||||
):
|
||||
log.debug(
|
||||
"Query is not allowed in %r (%d)", player.guild.name, player.guild.id
|
||||
"Query is not allowed in %r (%s)", player.guild.name, player.guild.id
|
||||
)
|
||||
continue
|
||||
valid = True
|
||||
|
||||
@@ -175,7 +175,7 @@ class PlaylistWrapper:
|
||||
try:
|
||||
playlist_id = int(playlist_id)
|
||||
except Exception as exc:
|
||||
log.verbose("Failed converting playlist_id to int", exc_info=exc)
|
||||
log.trace("Failed converting playlist_id to int", exc_info=exc)
|
||||
playlist_id = -1
|
||||
|
||||
output = []
|
||||
|
||||
@@ -102,7 +102,7 @@ class SpotifyWrapper:
|
||||
async with self.session.request("GET", url, params=params, headers=headers) as r:
|
||||
data = await r.json(loads=json.loads)
|
||||
if r.status != 200:
|
||||
log.verbose("Issue making GET request to %r: [%d] %r", url, r.status, data)
|
||||
log.verbose("Issue making GET request to %r: [%s] %r", url, r.status, data)
|
||||
return data
|
||||
|
||||
async def update_token(self, new_token: Mapping[str, str]):
|
||||
@@ -156,7 +156,7 @@ class SpotifyWrapper:
|
||||
async with self.session.post(url, data=payload, headers=headers) as r:
|
||||
data = await r.json(loads=json.loads)
|
||||
if r.status != 200:
|
||||
log.verbose("Issue making POST request to %r: [%d] %r", url, r.status, data)
|
||||
log.verbose("Issue making POST request to %r: [%s] %r", url, r.status, data)
|
||||
return data
|
||||
|
||||
async def make_get_call(self, url: str, params: MutableMapping) -> MutableMapping:
|
||||
|
||||
Reference in New Issue
Block a user