From d6936c87f3422d27d4649534a46fd9852676379f Mon Sep 17 00:00:00 2001 From: Draper <27962761+Drapersniper@users.noreply.github.com> Date: Sun, 12 Jan 2020 22:37:04 +0000 Subject: [PATCH] chore (#3348) Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> --- changelog.d/audio/3345.enhance.1.rst | 1 + redbot/cogs/audio/utils.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog.d/audio/3345.enhance.1.rst diff --git a/changelog.d/audio/3345.enhance.1.rst b/changelog.d/audio/3345.enhance.1.rst new file mode 100644 index 000000000..1a1767590 --- /dev/null +++ b/changelog.d/audio/3345.enhance.1.rst @@ -0,0 +1 @@ +Fix an issues with the formatting of non existing local tracks. \ No newline at end of file diff --git a/redbot/cogs/audio/utils.py b/redbot/cogs/audio/utils.py index b4cffcb02..e44abab2e 100644 --- a/redbot/cogs/audio/utils.py +++ b/redbot/cogs/audio/utils.py @@ -213,7 +213,7 @@ async def clear_react(bot: Red, message: discord.Message, emoji: MutableMapping def get_track_description(track) -> Optional[str]: if track and getattr(track, "uri", None): query = Query.process_input(track.uri) - if query.is_local: + if query.is_local or "localtracks/" in track.uri: if track.title != "Unknown title": return f'**{escape(f"{track.author} - {track.title}")}**' + escape( f"\n{query.to_string_user()} " @@ -229,7 +229,7 @@ def get_track_description(track) -> Optional[str]: def get_track_description_unformatted(track) -> Optional[str]: if track and hasattr(track, "uri"): query = Query.process_input(track.uri) - if query.is_local: + if query.is_local or "localtracks/" in track.uri: if track.title != "Unknown title": return escape(f"{track.author} - {track.title}") else: