CC-3928: Use liquidsoap to test whether file is playable on upload.
-done -tests return value and output
This commit is contained in:
parent
df518fb03f
commit
55634ddd46
1 changed files with 2 additions and 2 deletions
|
@ -886,9 +886,9 @@ Logging::log("getting media! - 2");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if file is playable
|
// Check if file is playable
|
||||||
$command = sprintf("/usr/bin/airtime-liquidsoap -c 'output.dummy(audio_to_stereo(single(\"%s\")))' > /dev/null 2>&1", $audio_file);
|
$command = sprintf("/usr/bin/airtime-liquidsoap -c 'output.dummy(audio_to_stereo(single(\"%s\")))' 2>&1", $audio_file);
|
||||||
exec($command, $output, $rv);
|
exec($command, $output, $rv);
|
||||||
if ($rv != 0) {
|
if ($rv != 0 || count($output) != 0) {
|
||||||
$result = array("code" => 110, "message" => "This file appears to be corrupted and will not be added to media library.");
|
$result = array("code" => 110, "message" => "This file appears to be corrupted and will not be added to media library.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue