rekordbox_set_list_manager.services.streaming_base#

Abstract base class for streaming music service integrations.

Classes#

StreamingService

Common interface for Spotify and Tidal (and future) streaming services.

Module Contents#

class rekordbox_set_list_manager.services.streaming_base.StreamingService[source]#

Bases: abc.ABC

Common 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 *ServiceError when not yet authenticated.

abstractmethod try_silent_authenticate()[source]#

Try to authenticate using cached credentials without user interaction.

Returns:

The display name on success, or None if 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 True if an active session exists.

Returns:

True when 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 dict with 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 is 0.

Return type:

tuple[list[Track], int]