rekordbox_set_list_manager.services.streaming_base#
Abstract base class for streaming music service integrations.
Classes#
Common interface for Spotify and Tidal (and future) streaming services. |
Module Contents#
- class rekordbox_set_list_manager.services.streaming_base.StreamingService[source]#
Bases:
abc.ABCCommon interface for Spotify and Tidal (and future) streaming services.
Concrete subclasses must implement all abstract methods. Each method that requires authentication should raise the service-specific
*ServiceErrorwhen not yet authenticated.- abstractmethod try_silent_authenticate()[source]#
Try to authenticate using cached credentials without user interaction.
- Returns:
The display name on success, or
Noneif no cached session is available or the cached token has expired.- Return type:
str | None
- abstractmethod authenticate(link_callback=None)[source]#
Authenticate and return the connected user’s display name.
- Parameters:
link_callback (Callable[[str], None] | None) – Passed the login URL for device-code flows (Tidal). Ignored for browser-redirect flows (Spotify).
- Returns:
The authenticated user’s display name.
- Return type:
str
- abstractmethod is_authenticated()[source]#
Return
Trueif an active session exists.- Returns:
Truewhen the service has an active authenticated session.- Return type:
bool
- abstractmethod get_playlists()[source]#
Return the authenticated user’s playlists.
- Returns:
Each item is a
dictwith at minimum"id"and"name"keys.- Return type:
list[dict]
- abstractmethod get_playlist_tracks(playlist_id)[source]#
Fetch all tracks from playlist_id.
- Parameters:
playlist_id (str) – The service-specific playlist identifier.
- Returns:
(tracks, skipped)where skipped is the count of items that could not be imported. For services that do not track skipped items, skipped is0.- Return type:
tuple[list[Track], int]