mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-04-01 00:35:30 +02:00
Add file size addition during uploading
This commit is contained in:
parent
7fd13632eb
commit
f5987db735
1 changed files with 16 additions and 9 deletions
|
@ -143,7 +143,7 @@ class UploadTrackCommand extends CommandBase
|
||||||
}
|
}
|
||||||
$track->trackFiles()->save($trackFile);
|
$track->trackFiles()->save($trackFile);
|
||||||
|
|
||||||
if ($trackFile->is_cacheable == false) {
|
// Encode track file
|
||||||
$target = $destination . '/' . $trackFile->getFilename();
|
$target = $destination . '/' . $trackFile->getFilename();
|
||||||
|
|
||||||
$command = $format['command'];
|
$command = $format['command'];
|
||||||
|
@ -155,6 +155,13 @@ class UploadTrackCommand extends CommandBase
|
||||||
|
|
||||||
$process = new Process($command);
|
$process = new Process($command);
|
||||||
$process->mustRun();
|
$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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue