From 33ccbc470cc1f2f2eb2ea2a8c4fef33b2cb81a26 Mon Sep 17 00:00:00 2001 From: Kamil Date: Fri, 29 Nov 2024 22:48:06 +0000 Subject: [PATCH] Added Identifier to base and implementation --- app/providers/base.py | 10 +++++++++- app/providers/spotify.py | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/providers/base.py b/app/providers/base.py index 9fa0956..6968a80 100644 --- a/app/providers/base.py +++ b/app/providers/base.py @@ -88,7 +88,15 @@ class MusicProviderClient(ABC): """ Abstract base class defining the interface for music provider clients. """ - + @property + @abstractmethod + def _identifier(self) -> str: + """ + A unique identifier for the music provider. + Must be implemented by all subclasses. + """ + pass + @abstractmethod def authenticate(self, credentials: dict) -> None: """ diff --git a/app/providers/spotify.py b/app/providers/spotify.py index cefa375..83f1f06 100644 --- a/app/providers/spotify.py +++ b/app/providers/spotify.py @@ -32,7 +32,10 @@ class SpotifyClient(MusicProviderClient): """ Spotify implementation of the MusicProviderClient. """ - + @property + def _identifier(self) -> str: + return "Spotify" + def __init__(self, cookie_file: Optional[str] = None): self.base_url = "https://api-partner.spotify.com" self.session_data = None