Playlist

class Playlist(parent=None)

Bases: Item

This class describes a Playlist object child of Item class.

add_playlist(playlist_key)

Add an existing playlist into the current playlist

Parameters:

playlist_key (string) – The playlist _key to add in the current playlist

Returns:

The created edge between the current playlist and the imported one

Return type:

Edge

change_media_track(media_key, track=0)

Move the media to another track

Parameters:
  • media_key (string) – Item media _key to remove from the playlist

  • track (integer (0 or 1), optional (default: 0)) – The ID of the track where the media will be imported. If no track specified, media are imported in the first track

Returns:

None

Return type:

None

get_medias(track=None)

Gets the medias of the playlist

Parameters:

track (integer (0 or 1), optional (default: None)) – The ID of the track. If no track specified, all medias will be returned

Returns:

List of Media object

Return type:

List of dictionary {media: Media, track: integer, versionKey: integer}

get_playlists()

Gets the playlists added in this playlist

Returns:

List of Playlist object

Return type:

List of Playlist

import_medias(media_paths, track=0)

Import media files into the playlist

Parameters:
  • media_paths (list, optional) – List of media file paths that need to be imported in the playlist

  • track (integer (0 or 1), optional (default: 0)) – The ID of the track where the media will be imported. If no track specified, media are imported in the first track

Returns:

List of Media object

Return type:

List of Media

remove_media(media_key)

Remove media from the playlist

Parameters:

media_key (string) – Item media _key to remove from the playlist

Returns:

None

Return type:

None

remove_playlist(playlist_key)

Remove the imported playlist from the current playlist

Parameters:

media_key (string) – Item playlist _key to remove from the playlist

Returns:

None

Return type:

None