mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
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:
@@ -67,18 +67,18 @@ class FilesystemService
|
|||||||
return $pathdest . $this->generateSubdefFilename($record, $subdef);
|
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 = \p4string::addEndSlash($tmpDir);
|
||||||
$tmpDir = $tmpDir.$subdef->getSpecs()->getType()."/";
|
$ffmpegDir = $tmpDir."ffmpeg/";
|
||||||
|
|
||||||
if(!is_dir($tmpDir)){
|
if(!is_dir($ffmpegDir)){
|
||||||
$this->filesystem->mkdir($tmpDir);
|
$this->filesystem->mkdir($ffmpegDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
$filenameSufix = "_".$record->getDataboxId()."_".$this->generateSubdefFilename($record, $subdef);
|
$filenameSufix = "_".$record->getDataboxId()."_".$this->generateSubdefFilename($record, $subdef);
|
||||||
|
|
||||||
return $tmpDir . hash('sha256', $filenameSufix) . $filenameSufix;
|
return $ffmpegDir . hash('sha256', $filenameSufix) . $filenameSufix;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -178,9 +178,9 @@ class SubdefGenerator
|
|||||||
|
|
||||||
$destFile = null;
|
$destFile = null;
|
||||||
|
|
||||||
if(!empty($this->tmpDirectory)){
|
if($subdef_class->getSpecs() instanceof Video && !empty($this->tmpDirectory)){
|
||||||
$destFile = $pathdest;
|
$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) {
|
if (isset($this->tmpFilePath) && $subdef_class->getSpecs() instanceof Image) {
|
||||||
|
Reference in New Issue
Block a user