Skip to content

See #170: updates to upload API to support channels publishing

Agate requested to merge 170-uploads into develop

See #170 (closed) and also cf https://mastodon.eliotberriot.com/@eliotberriot/103204268225895127

One current blocking point for channels is that we don't have the necessary APIs to provide a decent audio publication experience.

E.g you cannot upload a file, edit the metadata, then come back at it two days later, add some tags, and hit publish.

First of all, there is no current way to tell Funkwhale "please don't use audio tags embedded in the files to infer metadata, use this values as title, artist and album instead". More, currently, once uploaded, a track is picked up immediatly and published.

This MR deals with that by:

  • Adding a new draft option for the import_status column on the upload table so that API clients can prevent an upload to be processed by the workers (this field can be specified during API calls to POST /api/v1/uploads)
  • Support PATCH requests on /api/v1/uploads/<uuid> (only for draft uploads) so that API clients can update audio metadata, audio file, change the library to publish the upload in, etc. Once the client is done, this endpoint can be called with {import_status: pending} to freeze the record and trigger processing from the server
  • Add a new GET /api/v1/uploads/<uuid>/audio-file-metadata endpoint to retrive ID3 / embedded tags from the audio file itself (one use will be to prefill fields in the channel publishing form)
  • Support for specifying {import_metadata: {…}} when creating or patching an upload, to bypass entirely the use of file tags (typical use will be to allow uploads and publication for untagged files)

API documentation was updated to reflect the change.

ready for review, @funkwhale/reviewers-python

Edited by Agate

Merge request reports