Add file size addition during uploading

This commit is contained in:
Kelvin Zhang 2015-10-29 16:26:01 +00:00
parent 7fd13632eb
commit f5987db735

View file

@ -143,7 +143,7 @@ class UploadTrackCommand extends CommandBase
}
$track->trackFiles()->save($trackFile);
if ($trackFile->is_cacheable == false) {
// Encode track file
$target = $destination . '/' . $trackFile->getFilename();
$command = $format['command'];
@ -155,6 +155,13 @@ class UploadTrackCommand extends CommandBase
$process = new Process($command);
$process->mustRun();
// Update file size for track file
$trackFile->updateFilesize();
// Delete track file if it is cacheable
if ($trackFile->is_cacheable == true) {
\Illuminate\Support\Facades\File::delete($trackFile->getFile());
}
}