Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions plistsync/core/playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MyPlaylistCollection(PlaylistCollection):
from __future__ import annotations

from abc import ABC, abstractmethod
from collections.abc import Hashable
from collections.abc import Hashable, Sequence
from contextlib import contextmanager
from copy import deepcopy
from dataclasses import dataclass
Expand Down Expand Up @@ -79,11 +79,33 @@ class PlaylistCollection(Generic[T], Collection[T], TrackStream[T], ABC):

"""

@abstractmethod
def __init__(
self,
title: str,
description: str | None = None,
tracks: Sequence[Track] | None = None,
) -> None:
"""Initialize the playlist.

This should create a local object that is **not** linked
to the service (yet).

Parameters
----------
title : str
The name of the playlist.
description : str, optional
An optional description of the playlist.
tracks : Sequence[Track], optional
Initial list of tracks to include in the playlist.
"""
...

@property
@abstractmethod
def info(self) -> PlaylistInfo:
"""
Get this playlist's information.
"""Get this playlist's information.

Subclasses need return a reference, so that the setters for name
etc. that are defined here, write back.
Expand Down
Loading