change temporary storage config

This commit is contained in:
aina-esokia
2018-06-19 10:58:34 +04:00
parent d306d292eb
commit 4e1190a156
2 changed files with 12 additions and 3 deletions

View File

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

View File

@@ -174,10 +174,10 @@ class SubdefGenerator
return;
}
$tmpDir = $this->app['conf']->get(['registry', 'executables', 'ffmpeg-tmp-directory']);
$tmpDir = $this->app['conf']->get(['main', 'storage', 'tmp_files']);
$destFile = null;
if($subdef_class->getSpecs() instanceof Video && !empty($tmpDir) && is_dir($tmpDir)){
if($subdef_class->getSpecs() instanceof Video && !empty($tmpDir)){
$destFile = $pathdest;
$pathdest = $this->filesystem->generateTemporarySubdefPathname($record, $subdef_class, $tmpDir);
}