Check for existence of path before scanning it generating a lot of erros
parent
6331d79a73
commit
56999da3eb
|
@ -581,10 +581,12 @@ ZM\Debug("Figuring out height using width: $height = ($width * $oldHeight) / $ol
|
|||
|
||||
function find_video($path) {
|
||||
# Look for other mp4s
|
||||
$files = scandir($path);
|
||||
foreach ($files as $file) {
|
||||
if (preg_match('/.mp4$/i', $file)) {
|
||||
return $file;
|
||||
if (file_exists($path)) {
|
||||
$files = scandir($path);
|
||||
foreach ($files as $file) {
|
||||
if (preg_match('/.mp4$/i', $file)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue