QutEcoacoustics / baw-server

The acoustic workbench server for storing and managing ecoacoustic data. Manages the structure and audio data. Provides an API for clients access.
Apache License 2.0
9 stars 4 forks source link

Bad sample rate validations in .../media #187

Closed atruskie closed 9 years ago

atruskie commented 9 years ago

GET http://baw.ecosounds.org/audio_recordings/192375/media.png?end_offset=60&start_offset=30&sample_rate=22050user_token=IAMANAUTHTOKEN

Generates a resque request that fails. Note the missing ampersand for the last QSP.

Theory: sample_rate check not done until resque uses audio workers code. It should be done before job is issued.

atruskie commented 9 years ago

Basic DX reveals that the invalid parameter is being passed right through to SOX

sox FAIL rate: usage: [-q|-l|-m|-h|-v] [...

cofiem commented 9 years ago

turns out the issue is:

'22050user_token=IAMANAUTHTOKEN'.to_i == 22050

More robust value checking required...