Browse Source

improve snapshot description file parse

master
filesite 3 years ago
parent
commit
35d05236a7
  1. 5
      lib/DirScanner.php

5
lib/DirScanner.php

@ -84,8 +84,8 @@ Class DirScanner {
if (in_array($field, ['title', 'snapshot'])) { if (in_array($field, ['title', 'snapshot'])) {
$content = preg_replace('/\s/', '', $content); $content = preg_replace('/\s/', '', $content);
if ($field == 'snapshot') { if ($field == 'snapshot') {
$img_realpath = str_replace("{$pathinfo['filename']}.{$pathinfo['extension']}", $content, $realpath); $img_realpath = "{$pathinfo['dirname']}/{$content}";
echo "img_realpath: ".$img_realpath."\n"; if (file_exists($img_realpath)) {
$id = $this->getId($img_realpath); $id = $this->getId($img_realpath);
$fp = fopen($img_realpath, 'r'); $fp = fopen($img_realpath, 'r');
$fstat = fstat($fp); $fstat = fstat($fp);
@ -95,6 +95,7 @@ Class DirScanner {
$content = $this->getFilePath( $id, $this->getDirectoryName($img_pathinfo['dirname'], $dirLevel), $img_pathinfo['filename'], $extension, $fstat['mtime'] ); $content = $this->getFilePath( $id, $this->getDirectoryName($img_pathinfo['dirname'], $dirLevel), $img_pathinfo['filename'], $extension, $fstat['mtime'] );
} }
} }
}
$data[$field] = $content; $data[$field] = $content;
return $data; return $data;

Loading…
Cancel
Save