Added Identifier to base and implementation

This commit is contained in:
Kamil
2024-11-29 22:48:06 +00:00
parent 3c25cd70ea
commit 33ccbc470c
2 changed files with 13 additions and 2 deletions

View File

@@ -88,7 +88,15 @@ class MusicProviderClient(ABC):
""" """
Abstract base class defining the interface for music provider clients. 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 @abstractmethod
def authenticate(self, credentials: dict) -> None: def authenticate(self, credentials: dict) -> None:
""" """

View File

@@ -32,7 +32,10 @@ class SpotifyClient(MusicProviderClient):
""" """
Spotify implementation of the MusicProviderClient. Spotify implementation of the MusicProviderClient.
""" """
@property
def _identifier(self) -> str:
return "Spotify"
def __init__(self, cookie_file: Optional[str] = None): def __init__(self, cookie_file: Optional[str] = None):
self.base_url = "https://api-partner.spotify.com" self.base_url = "https://api-partner.spotify.com"
self.session_data = None self.session_data = None