From c3790befce50c82dbc3659c490490a769c80d7a9 Mon Sep 17 00:00:00 2001 From: aina-esokia Date: Fri, 31 Aug 2018 18:16:52 +0400 Subject: [PATCH] fix size in task log --- lib/Alchemy/Phrasea/Media/SubdefGenerator.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Alchemy/Phrasea/Media/SubdefGenerator.php b/lib/Alchemy/Phrasea/Media/SubdefGenerator.php index 842a437a65..2dede228c5 100644 --- a/lib/Alchemy/Phrasea/Media/SubdefGenerator.php +++ b/lib/Alchemy/Phrasea/Media/SubdefGenerator.php @@ -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(),