playlist_new

🟢 Stable

This API is stable since festivald v1.0.0.


Create a new empty Playlist, overwriting an existing one.

Inputs

FieldTypeDescription
playliststringThe name of the new Playlist

Outputs

FieldTypeDescription
lenoptional (maybe-null) unsigned integerIf the Playlist 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 the Playlist existed (and thus, overwritten), its Playlist Entry's are returned, else if it didn't exist, null

Example Request

festival-cli playlist_new --playlist "Playlist 1"
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"playlist_new","params":{"playlist":"Playlist 1"}}'

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
}