Import/export xspf playlist (#836).
requested to merge petitminion/funkwhale-petitminion:836-playlist-import-export-backend into develop
Closes #2340
@Sporiff api desgin :
- GET from the
/api/v2/playlists/{guid}
endpoint and receive either:-
application/json
: a summary of the playlist -
application/octet-stream
: the full exported XSPF file
-
- POST to the
/api/v2/playlists
endpoint and post either:-
application/json
: a small amount of metadata about the created playlist -
application/octet-stream
: an XSPF file containing the playlist data
-
- PATCH the
/api/v2/playlists/{guid}
endpoint using either:-
application/json
: updated fields for the playlist metadata -
application/octet-stream
: an updated XSPF file containing updated information about the playlist
-
# create playlist
curl --user y:funkwhale -H "Content-Type: application/json" -X POST "https://node1.funkwhale.test/api/v1/playlists/" -d '{"name":"test", "privacy_level": "me"}'
# get xspf
curl --user y:funkwhale -H "Content-Type: application/octet-stream" -X GET "https://node1.funkwhale.test/api/v2/playlists/1/"
# patch with xspf file
curl --user y:funkwhale -H "Content-Type: application/octet-stream" -X PATCH "https://node1.funkwhale.test/api/v2/playlists/1" --data-binary @/home/nulachi/Downloads/test.xspf
Edited by petitminion