jspf

From MusicBrainz Wiki
Jump to navigationJump to search

Introduction

The ListenBrainz team is currently working to create Playlist support and we've chosen JSPF as our playlist transport format. This format will be used for importing/exporting playlists, in our API and internally between our web servers and the client browser sessions.

There are a number of fields that we require that are not part of JSPF/XSPF, so we've defined two extensions to JSPF. Our proposed format example is here:

{
   "playlist" : {
      "extension" : {
         "https://musicbrainz.org/doc/jspf#playlist" : {
            "created_for" : "Mr_Monkey",
            "creator" : "troi-bot",
            "collaborators" : [
               "rob",
               "alastairp",
               "zas"
            ],
            "copied_from" : "https://listenbrainz.org/playlist/9dae92c5-c98e-4e7e-9c15-8b6d32607aed",
            "copied_from_deleted": true,
            "public" : "true",
            "last_modified_at": "2020-11-27T10:45:49+00:00"
         }
      },
      "creator" : "ListenBrainz Troi",
      "date" : "2005-01-08T17:10:47-05:00",
      "title" : "1980s flashback jams",
      "track" : [
         {
            "title" : "Gold",
            "identifier" : "https://musicbrainz.org/recording/e8f9b188-f819-4e43-ab0f-4bd26ce9ff56",
            "creator" : "Spandau Ballet",
            "extension" : {
               "https://musicbrainz.org/doc/jspf#track" : {
                  "added_by" : "zas",
                  "artist_identifier" : [
                     "https://musicbrainz.org/artist/4c0d9acf-a8a1-4765-9c56-05f92f68c048"
                  ],
                  "added_at" : "2020-11-27T10:45:49+00:00",
                  "release_identifier" : "https://musicbrainz.org/release/8d3acbb4-c541-4324-a124-a670615f0f77"
               }
            },
            "album" : "True"
         }
      ],
      "identifier" : "https://listenbrainz.org/playlist/7f4cf4d3-f5ca-453a-b5c8-00e8a30a9bac"
   }
}

playlist

The https://musicbrainz.org/doc/jspf#playlist namespace defines the following fields that augment the data about a playlist:

  • creator: The ListenBrainz user who created this playlist.
  • created_for: Which ListenBrainz user was the playlist generated for? This is for music recommendation bots generating playlists for users.
  • collaborators: Who are the ListenBrainz users who have access to edit this playlist?
  • copied_from: This field identifies a playlist, using the identifier syntax, from which this playlist was copied from.
  • copied_from_deleted: If the source playlist that this playlist has been copied from has been deleted, this field will be set to true and the copied_from field will not be returned.
  • public: Indicates if this playlist is public or private. Must contain the value "true" or "false".
  • last_modified_at: The timestamp for when this playlist was last modified.

track

The https://musicbrainz.org/doc/jspf#track namespace defines the following fields that augment the data about a particular track:

  • added_by: The ListenBrainz user who added this track.
  • artist_mbids: A list of MusicBrainz Artist URIs that identify the artist that are part of the MusicBrainz artist credit id for this track.
  • added_at: The timestamp for when this track was added to the playlist.
  • release_identifier: The MusicBrainz ID URI for the release that contained this track.