plistsync.core.trackΒΆ
Abstract representation of a music track.
OverviewΒΆ
A serialized track. |
|
An abstract class representing a track. |
|
A offline (in memory) track with attached service. |
Module ContentsΒΆ
- 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 ids: frozenset[plistsync.core.ids.TrackID]ΒΆ
- Abstractmethod:
The identifiers of this track.
- 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.
- class plistsync.core.track.OfflineTrack(info: TrackInfo, ids: collections.abc.Iterable[plistsync.core.ids.TrackID] | None = None)ΒΆ
Bases:
TrackA offline (in memory) track with attached service.
This class provides a concrete implementation of Track for managing tracks in memory without any connection to online music services. It is useful as an intermediate representation during matching or syncing.
- merge(track: Track) OfflineTrackΒΆ
Merge another track into this one.
This operation returns a new offline track with the merged data.
- classmethod from_track(track: Track) OfflineTrackΒΆ
Create a offline track from arbitrary other track.