mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
Merge pull request #2721 from aynsix/PHRAS-2175-task-log-size
PHRAS-2175 fix size in task log
This commit is contained in:
@@ -170,6 +170,7 @@ class SubdefGenerator
|
|||||||
private function generateSubdef(\record_adapter $record, \databox_subdef $subdef_class, $pathdest)
|
private function generateSubdef(\record_adapter $record, \databox_subdef $subdef_class, $pathdest)
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
|
$destFile = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (null === $record->get_hd_file()) {
|
if (null === $record->get_hd_file()) {
|
||||||
@@ -178,8 +179,6 @@ class SubdefGenerator
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$destFile = null;
|
|
||||||
|
|
||||||
if($subdef_class->getSpecs() instanceof Video && !empty($this->tmpDirectory)){
|
if($subdef_class->getSpecs() instanceof Video && !empty($this->tmpDirectory)){
|
||||||
$destFile = $pathdest;
|
$destFile = $pathdest;
|
||||||
$pathdest = $this->filesystem->generateTemporaryFfmpegPathname($record, $subdef_class, $this->tmpDirectory);
|
$pathdest = $this->filesystem->generateTemporaryFfmpegPathname($record, $subdef_class, $this->tmpDirectory);
|
||||||
@@ -214,7 +213,12 @@ class SubdefGenerator
|
|||||||
$duration = $stop - $start;
|
$duration = $stop - $start;
|
||||||
|
|
||||||
$originFileSize = $this->sizeHumanReadable($record->get_hd_file()->getSize());
|
$originFileSize = $this->sizeHumanReadable($record->get_hd_file()->getSize());
|
||||||
|
|
||||||
|
if($destFile){
|
||||||
|
$generatedFileSize = $this->sizeHumanReadable(filesize($destFile));
|
||||||
|
}else{
|
||||||
$generatedFileSize = $this->sizeHumanReadable(filesize($pathdest));
|
$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',
|
$this->logger->info(sprintf('*** Generated *** %s , duration=%s / source size=%s / %s size=%s / sbasid=%s / databox=%s / recordid=%s',
|
||||||
$subdef_class->get_name(),
|
$subdef_class->get_name(),
|
||||||
|
|||||||
Reference in New Issue
Block a user