Skip to content
Merged
140 changes: 137 additions & 3 deletions api-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ components:
- length
- image_url
- collaborative
- can_edit
- folder
properties:
uri:
Expand Down Expand Up @@ -297,6 +298,11 @@ components:
collaborative:
description: Whether the playlist is collaborative
type: boolean
can_edit:
description: >-
Whether the user may add items to the playlist, true for their own
and for collaborative playlists
type: boolean
folder:
description: >-
Names of the folders containing the playlist, outermost first;
Expand All @@ -323,6 +329,57 @@ components:
type: array
items:
$ref: '#/components/schemas/libraryPlaylist'
likedState:
x-go-name: ApiLikedState
description: Whether a track is in the user's Liked Songs
type: object
required: [ uri, liked ]
properties:
uri:
description: Track URI
type: string
liked:
description: Whether the track is in Liked Songs
type: boolean
likedStates:
x-go-name: ApiLikedStates
description: Liked Songs membership of the requested tracks
type: object
required: [ items ]
properties:
items:
description: One entry per requested URI, in request order
type: array
items:
$ref: '#/components/schemas/likedState'
setLiked:
x-go-name: ApiSetLiked
description: A save to or remove from Liked Songs payload
type: object
required: [ uris, liked ]
properties:
uris:
description: Track URIs, 1 to 50
type: array
items:
type: string
liked:
description: True to add the tracks to Liked Songs, false to remove them
type: boolean
playlistAddTracks:
x-go-name: ApiPlaylistAddTracks
description: An append to playlist payload
type: object
required: [ playlist_uri, uris ]
properties:
playlist_uri:
description: URI of the playlist to append to
type: string
uris:
description: Track or episode URIs to append, 1 to 50
type: array
items:
type: string
root:
x-go-name: ApiRoot
description: API reachability and playback readiness
Expand Down Expand Up @@ -597,9 +654,10 @@ paths:

Tracks and episodes are both listed, so shows enumerate to their
episodes. Long contexts are truncated to metadata.max_tracks. Listings
are reused for five minutes, so an edit made to a playlist within that
window is not reflected. Requires metadata.enabled; responds 404
otherwise.
are reused for five minutes, so an edit made elsewhere within that
window is not reflected; edits made through /library/liked and
/library/playlists/add_tracks are. Requires metadata.enabled; responds
404 otherwise.
parameters:
- name: uri
in: query
Expand Down Expand Up @@ -660,6 +718,82 @@ paths:
description: No active session
400:
description: The offset or limit is out of range
/library/liked:
get:
operationId: getLiked
description: >-
Tell whether tracks are in the user's Liked Songs, asking the
collection service for just these tracks, so changes made on other
devices show at once.
parameters:
- name: uris
in: query
required: true
description: Comma-separated track URIs, 1 to 50
style: form
explode: false
schema:
type: array
items:
type: string
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/likedStates'
204:
description: No active session
400:
description: The uris are missing, too many, or not track URIs
post:
operationId: setLiked
description: >-
Save tracks to, or remove them from, the user's Liked Songs through the
internal collection service.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/setLiked'
responses:
200:
description: Successful response
204:
description: No active session
400:
description: The uris are missing, too many, or not track URIs
/library/playlists/add_tracks:
post:
operationId: playlistAddTracks
description: >-
Append tracks or episodes to the end of a playlist the user may edit
(see can_edit in /library/playlists). The change is based on the
playlist's current revision and retried once if the playlist changed
in between.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/playlistAddTracks'
responses:
200:
description: Successful response
204:
description: No active session
400:
description: >-
The playlist_uri is not a playlist URI, or the uris are missing,
too many, or not track or episode URIs
403:
description: The user may not edit the playlist
404:
description: The playlist does not exist
409:
description: The playlist kept changing while appending
/player/play:
post:
operationId: playerPlay
Expand Down
122 changes: 122 additions & 0 deletions daemon/api_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading