plistsync.core.trackΒΆ
Abstract representation of a music track.
OverviewΒΆ
Global Unique identifiers for a track. |
|
Locally scoped identifiers for a track. |
|
A serialized track. |
|
An abstract class representing a track. |
Module ContentsΒΆ
- class plistsync.core.track.GlobalTrackIDsΒΆ
Bases:
TypedDictGlobal Unique identifiers for a track.
Each identifier in this collection should uniquely identify a track across all systems and collections. Unlike local identifiers, these are intended to allow unambiguous track matching across devices, libraries, or services.
Corresponds to collections-protocol GlobalLookup.
- class plistsync.core.track.LocalTrackIDsΒΆ
Bases:
TypedDictLocally scoped identifiers for a track.
These identifiers are unique only within a specific collection or context, such as a local library, playlist, database, or device. They are intended for identifying a track within that local scope and may not be unique globally.
Corresponds to collections-protocol LocalLookup.
- file_path: pathlib.PurePathΒΆ
Local (pure) filesystem path to the track file.
This is not globally unique because file paths may differ across devices or mount points, even if the underlying track is the same. (This is also why we use PurePath, which is OS-agnostic, instead of Path.)
- class plistsync.core.track.TrackInfoΒΆ
Bases:
TypedDictA serialized track.
This is the dictionary representation of a track.
Corresponds to collections-protocol InfoLookup.
- class plistsync.core.track.TrackΒΆ
Bases:
abc.ABCAn abstract class representing a track.
A track is a piece of music. It has a title, artists, albums and identifiers. It can be used in a number of places where the generic information about a track is needed.
- property artists: list[str]ΒΆ
The name of the artists.
The first artist is the main artist. If the track has no artist, return an empty list.
- property albums: list[str]ΒΆ
The name of the albums the track is in.
If the track is not in any album, return empty list.
- property path: pathlib.PurePath | NoneΒΆ
The path to the file of the track.
- property primary_artist: str | NoneΒΆ
The main artist of the track.
If the track has no artist, return an empty string.
- property global_ids: GlobalTrackIDsΒΆ
- Abstractmethod:
The globally unique identifiers of this track.
- property local_ids: LocalTrackIDsΒΆ
- Abstractmethod:
The locally unique identifiers of this track.