playlist_clone

🟢 Stable

This API is stable since festivald v1.0.0.


Clone an existing Playlist and all it's Entry's into a new one.

This method errors if from does not exist.

If to already exists, it will be overwritten.

Inputs

FieldTypeDescription
fromstringThe name of the Playlist to clone FROM
tostringThe name of the new Playlist to clone TO

Outputs

FieldTypeDescription
lenoptional (maybe-null) unsigned integerIf to already existed (and thus, overwritten), the amount of Playlist Entry's it had is returned, else if it didn't exist, null
entriesoptional (maybe-null) array of Playlist Entry objectsIf to already existed, its Playlist Entry's are returned, else if it didn't exist, null

Example Request

festival-cli playlist_clone --from original --to clone
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"playlist_remove","params":{"from":"original","to":"clone"}}'

Example Response 1

The playlist did not previously exist:

{
  "jsonrpc": "2.0",
  "result": {
    "len": null
    "entries": null
  },
  "id": 0
}

Example Response 2

The playlist previously existed, it was empty, and was overwritten:

{
  "jsonrpc": "2.0",
  "result": {
    "len": 0,
    "entries": []
  },
  "id": 0
}

Example Response 3

The playlist previously existed, it contained this 1 Playlist Entry, and was overwritten:

{
  "jsonrpc": "2.0",
  "result": {
    "len": 1,
    "entries": [
      {
        "valid": {
          "key_artist": 67,
          "key_album": 238,
          "key_song": 2588,
          "artist": "Rex Orange County",
          "album": "Apricot Princess",
          "song": "Waiting Room"
        }
      }
    ]
  },
  "id": 0
}