From d4c9ed99d0bb717606cfcbfe4f69523c6734a5b2 Mon Sep 17 00:00:00 2001 From: Parker Date: Thu, 18 Jul 2024 22:05:29 -0500 Subject: [PATCH] Prepare for another Custom Source --- code/cogs/skip.py | 2 +- code/{custom_source.py => custom_sources.py} | 12 +++++++++++- code/tree.py | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) rename code/{custom_source.py => custom_sources.py} (97%) diff --git a/code/cogs/skip.py b/code/cogs/skip.py index 966a8c2..b3645fb 100644 --- a/code/cogs/skip.py +++ b/code/cogs/skip.py @@ -6,7 +6,7 @@ from cogs.music import Music import asyncio from config import BOT_COLOR -from custom_source import LoadError +from custom_sources import LoadError class Skip(commands.Cog): diff --git a/code/custom_source.py b/code/custom_sources.py similarity index 97% rename from code/custom_source.py rename to code/custom_sources.py index 8ed2091..400c645 100644 --- a/code/custom_source.py +++ b/code/custom_sources.py @@ -5,6 +5,11 @@ class LoadError(Exception): # We'll raise this if we have trouble loading our t pass +""" +Retrieve the playback URL for a custom track +""" + + class CustomAudioTrack(DeferredAudioTrack): # A DeferredAudioTrack allows us to load metadata now, and a playback URL later. # This makes the DeferredAudioTrack highly efficient, particularly in cases @@ -36,7 +41,12 @@ class CustomAudioTrack(DeferredAudioTrack): return base64 -class CustomSource(Source): +""" +Custom Source for Spotify links +""" + + +class SpotifySource(Source): def __init__(self): super().__init__( name="custom" diff --git a/code/tree.py b/code/tree.py index a16f126..eff83b8 100644 --- a/code/tree.py +++ b/code/tree.py @@ -5,7 +5,7 @@ import datetime from cogs.music import CheckPlayerError from config import BOT_COLOR -from custom_source import LoadError +from custom_sources import LoadError class Tree(app_commands.CommandTree):