From: Vincent Date: Wed, 21 Aug 2019 09:49:02 +0000 (+0200) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=5b2fa58478eeaa34d7f48cbcda085137f631b0ea;p=tortuga-home.git . --- diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d538707..c37e091 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,13 +2,8 @@ - - - - - - + diff --git a/scripts/lib/medialibrary.php b/scripts/lib/medialibrary.php index 890a2be..ff36f6e 100644 --- a/scripts/lib/medialibrary.php +++ b/scripts/lib/medialibrary.php @@ -106,6 +106,7 @@ function mediaName($name, $context, $dir, $path) function transcodeOneVideo() { $list = getVideosList(true); + print_r($list); foreach ($list as $item) { /** @var SplFileInfo $item */ @@ -150,11 +151,12 @@ class DirFilter extends RecursiveFilterIterator return new DirFilter($this->getInnerIterator()->getChildren(), $this->exclude); } } + function getVideosList($shuffle = false) { global $videoExt; $res = array(); - $dirit = new RecursiveDirectoryIterator('/volume1/Share/Videos'); + $dirit = new RecursiveDirectoryIterator('/nas/Videos'); $filtered = new DirFilter($dirit, ['@eaDir']); $iterator = new RecursiveIteratorIterator($filtered, RecursiveIteratorIterator::CHILD_FIRST); foreach ($iterator as $f) { @@ -166,6 +168,7 @@ function getVideosList($shuffle = false) continue; } $path = $f->getRealPath(); + $codec = getVideoCodec($path); if ($codec != 'hevc') { @@ -184,7 +187,7 @@ function getVideosList($shuffle = false) function getVideoCodec($path) { - $cacheKey = 'codec_1_' . $path; + $cacheKey = 'codec_3_' . $path; $res = getState($cacheKey, null); if (null === $res) { $codecfile = $path . '.vc'; @@ -197,8 +200,8 @@ function getVideoCodec($path) $res = `ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$path"`; $res = trim($res); } + echo $path . '::' . $res . "\n"; setState($cacheKey, $res); - die($res); } return $res; } \ No newline at end of file