Skip to content
Client
Server

Reference / @open-music-sdk/lib-playlists / tPlaylistPlan

Interface: tPlaylistPlan ​

Defined in: lib/lib-playlists/src/plan.ts:63

What plan gives: the tracks a playlist is to hold, and what that takes. Plain, and frozen all the way down: it holds nothing of the caller's that could change under it, and can be written to a file and applied later.

Properties ​

append ​

ts
readonly append: readonly tLibraryPlaylistTracksRequestData[];

Defined in: lib/lib-playlists/src/plan.ts:78

The ones it does not hold yet, in order: what apply adds to its end. A wanted track is held when one of the playlist's tracks has its id, as its catalogId or as its own id. Each track of the playlist answers for one wanted track at most, so a song wanted twice and held once is added once more.


extra ​

ts
readonly extra: readonly tPlaylistSnapshotTrack[];

Defined in: lib/lib-playlists/src/plan.ts:80

The tracks it holds that are not wanted. Apple's API cannot take a track out, so they stay.


playlist ​

ts
readonly playlist: 
  | tNewPlaylist
  | {
  id: string;
};

Defined in: lib/lib-playlists/src/plan.ts:65

The playlist the plan is for: by its id, or by the name and description of one to find or make.

Union Members ​

tNewPlaylist


Type Literal ​
ts
{
  id: string;
}
id ​
ts
readonly id: string;

The id in the listener's library of a playlist that is there.


reordered ​

ts
readonly reordered: boolean;

Defined in: lib/lib-playlists/src/plan.ts:86

Whether the playlist, once what is missing is added, will hold the wanted tracks in another order than wanted: because it holds some of them in another order already, or because a track to add belongs before one it holds and can only go after it. Apple's API cannot move a track, or put one anywhere but at the end.


tracks ​

ts
readonly tracks: readonly tLibraryPlaylistTracksRequestData[];

Defined in: lib/lib-playlists/src/plan.ts:72

The tracks the playlist is to hold, each as { id, type }, in order.

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.