fix size in task log

This commit is contained in:
aina-esokia
2018-08-31 18:16:52 +04:00
parent 9975b99861
commit c3790befce

View File

@@ -170,6 +170,7 @@ class SubdefGenerator
private function generateSubdef(\record_adapter $record, \databox_subdef $subdef_class, $pathdest)
{
$start = microtime(true);
$destFile = null;
try {
if (null === $record->get_hd_file()) {
@@ -178,8 +179,6 @@ class SubdefGenerator
return;
}
$destFile = null;
if($subdef_class->getSpecs() instanceof Video && !empty($this->tmpDirectory)){
$destFile = $pathdest;
$pathdest = $this->filesystem->generateTemporaryFfmpegPathname($record, $subdef_class, $this->tmpDirectory);
@@ -214,7 +213,12 @@ class SubdefGenerator
$duration = $stop - $start;
$originFileSize = $this->sizeHumanReadable($record->get_hd_file()->getSize());
$generatedFileSize = $this->sizeHumanReadable(filesize($pathdest));
if($destFile){
$generatedFileSize = $this->sizeHumanReadable(filesize($destFile));
}else{
$generatedFileSize = $this->sizeHumanReadable(filesize($pathdest));
}
$this->logger->info(sprintf('*** Generated *** %s , duration=%s / source size=%s / %s size=%s / sbasid=%s / databox=%s / recordid=%s',
$subdef_class->get_name(),