collection_new

🟡 Incomplete

This API's output may have additions in the future.


Create a new Collection (and replace the current one).

While this method is in progress, other JSON-RPC/REST requests will be rejected.

festivald will respond with some stats when the Collection reset has finished.

Inputs

FieldTypeDescription
pathsoptional (maybe-null) array of PATHsAn array of filesystem PATHs to scan for the new Collection. These must be absolute PATHs on the system festivald is running on, not PATHs on the client. If null is provided, the default Music directory will be used.

Outputs

FieldTypeDescription
timefloatHow many seconds it took festivald to reset AND respond
emptybooleanIf the Collection does NOT have any Artist's, Album's, or Song's
timestampunsigned integerThe UNIX timestamp of when this Collection was created
count_artistunsigned integerHow many unique Artist's there are in this Collection
count_albumunsigned integerHow many unique Album's there are in this Collection
count_songunsigned integerHow many unique Song's there are in this Collection
count_artunsigned integerHow much unique Album art there are in this Collection

Example Request 1

Use default Music PATH.

festival-cli collection_new
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"collection_new","params":{"paths":null}}'

Example Request 2

Use the PATH /home/user/Music/collection on festivald's filesystem.

festival-cli collection_new --paths "/home/user/Music/collection"
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"collection_new","params":{"paths":["/home/user/Music/collection"]}}'

Example Request 3

Windows PATH works too if \ is escaped (and if festivald is running on Windows).

festival-cli collection_new --paths "C:\\Users\\User\\Music\\collection"
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"collection_new","params":{"paths":["C:\\Users\\User\\Music\\collection"]}}'

Example Response

{
  "jsonrpc": "2.0",
  "result": {
    "time": 0.462621988,
    "empty": false,
    "timestamp": 1690579397,
    "count_artist": 195,
    "count_album": 825,
    "count_song": 8543,
    "count_art": 824
  },
  "id": 0
}