Skip to content

Structure of `songs_dict`

Callum edited this page Sep 1, 2020 · 1 revision

The songs_dict is what passes between plugins during an applet flow. It must always follow the specified ultrasonics songs_dict format.

Playlist Structure

The songs_dict contains a list of playlists, which must follow the below structure:

[
    {
        "name": "New Music",
        "id": {
            "spotify": "57BFersiWpdyX0Yp81raiy"
        },
        "songs": [
            ...
        ]
    },
    {
        "name": "Chill",
        "id": {},
        "songs": [
            ...
        ]
    }
]

Each playlist contains three fields:

  • "name" is the name of the playlist. No two playlists can have the same name.
  • "id" contains any specific playlist ids for various services.
  • "songs" contains a list of songs inside the playlist.

All these fields must be present, even if the playlist is designed to work in songs-mode (i.e. only one playlist), or doesn't have a specific id.

Song Structure

Each song must also follow a specific structure:

{
    "title": "Never Be Like You",
    "artists": [
        "Flume",
        "Kai"
    ],
    "album": "Skin",
    "date": "2016-05-27",
    "isrc": "AUFF01500784",
    "location": "/media/music/Flume/Skin/Never Be Like You.m4a",
    "id": {
        "spotify": "476j7IDRIDRvv1Xu71EVc8",
        "deezer": "117176358"
    }
},
{
    "title": "Hold Your Colour - Noisia Remix",
    "artists": [
        "Noisia",
        "Pendulum"
    ],
    "album": "The Reworks",
    "date": "2018",
    "isrc": "UKNKE1800001"
},
{
    "title": "Tentacles",
    "artists": [
        "Noisia"
    ],
    "album": "Outer Edges",
    "date": "2016-08-05",
    "isrc": "NLCK41032641"
}

All fields are optional, but best practice is to include as many as possible. Preferred fields are "location" and "isrc" where applicable. Any included fields must follow the structure shown.

Plugins should be designed to work with any of the supplied fields, and not rely on a field being present (with the exception of path for e.g. local playlists, or Plex).