Merge pull request #2693 from aynsix/PHRAS-2118-rollback-tmpfiles-just-for-video

PHRAS-2118 rollback use just tmp_files storage for video
This commit is contained in:
Nicolas Maillat
2018-07-27 16:12:24 +02:00
committed by GitHub
2 changed files with 7 additions and 7 deletions

View File

@@ -67,18 +67,18 @@ class FilesystemService
return $pathdest . $this->generateSubdefFilename($record, $subdef);
}
public function generateTemporarySubdefPathname(\record_adapter $record, \databox_subdef $subdef, $tmpDir)
public function generateTemporaryFfmpegPathname(\record_adapter $record, \databox_subdef $subdef, $tmpDir)
{
$tmpDir = \p4string::addEndSlash($tmpDir);
$tmpDir = $tmpDir.$subdef->getSpecs()->getType()."/";
$ffmpegDir = $tmpDir."ffmpeg/";
if(!is_dir($tmpDir)){
$this->filesystem->mkdir($tmpDir);
if(!is_dir($ffmpegDir)){
$this->filesystem->mkdir($ffmpegDir);
}
$filenameSufix = "_".$record->getDataboxId()."_".$this->generateSubdefFilename($record, $subdef);
return $tmpDir . hash('sha256', $filenameSufix) . $filenameSufix;
return $ffmpegDir . hash('sha256', $filenameSufix) . $filenameSufix;
}
/**

View File

@@ -178,9 +178,9 @@ class SubdefGenerator
$destFile = null;
if(!empty($this->tmpDirectory)){
if($subdef_class->getSpecs() instanceof Video && !empty($this->tmpDirectory)){
$destFile = $pathdest;
$pathdest = $this->filesystem->generateTemporarySubdefPathname($record, $subdef_class, $this->tmpDirectory);
$pathdest = $this->filesystem->generateTemporaryFfmpegPathname($record, $subdef_class, $this->tmpDirectory);
}
if (isset($this->tmpFilePath) && $subdef_class->getSpecs() instanceof Image) {