Parisson / TimeSide

scalable audio processing framework and server written in Python
https://timeside.ircam.fr/docs/
GNU Affero General Public License v3.0
367 stars 60 forks source link

Validate items source on create / update #229

Closed gnuletik closed 1 year ago

gnuletik commented 3 years ago

When requesting a file from the API, the server fails with a 500 response.

Example on the sandbox : https://ircam-web.github.io/timeside-player/#/item/560e5aca-fa76-413e-afbd-2cf725525960

ValueError at /timeside/api/items/560e5aca-fa76-413e-afbd-2cf725525960/download/flac
Can't get file: The 'file' attribute has no file associated with it.
ValueError at /timeside/api/items/560e5aca-fa76-413e-afbd-2cf725525960/download/ogg
Can't get file: The 'file' attribute has no file associated with it.

The mp3 route responds with a 500 error and no error message.

Tointoin commented 3 years ago

There is no source_file nor external_id / external_url + provider nor source_url defined on this item. Thus there is no audio source to transcode to any codec via /download/<codec> . This special case of an item created without any source info may not be treated.

Tointoin commented 3 years ago

It works on this test case (given source_file): https://sandbox.wasabi.telemeta.org/timeside/api/items/b6651bd5-c65c-40e9-b538-39112597a4e7/download/mp3 and on this track provided from YouTube : https://sandbox.wasabi.telemeta.org/timeside/api/items/c58e0b07-95b1-4ab9-8585-d0910df43cc0/download/ogg

confirming my comment :confused:

There is no source_file nor external_id / external_url + provider nor source_url defined on this item. Thus there is no audio source to transcode to any codec via /download/ . This special case of an item created without any source info may not be treated.

Those cases without any audio source should be detected and :

gnuletik commented 3 years ago

Awesome ! Thanks for such a response @Tointoin !

Totally makes sense to prevent creating invalid items. I'll rename the issue :)

yomguy commented 1 year ago

Done through better task management