update thumbnail logic to use [id]_thumb.jpg in out-dir

This commit is contained in:
hbrain 2026-06-02 07:58:40 +02:00
parent f91f84c12d
commit 663243e956
2 changed files with 8 additions and 6 deletions

View file

@ -62,8 +62,8 @@ function video_thumb_public_url($config, $videoName){
if ($videoName === '') return '';
$base = pathinfo($videoName, PATHINFO_FILENAME);
foreach (['jpg','jpeg','png','webp','gif'] as $ext) {
$file = $config['thumbs_dir'] . '/' . $base . '.' . $ext;
if (is_file($file)) return $config['public_thumbs'] . '/' . rawurlencode($base . '.' . $ext) . '?v=' . filemtime($file);
$file = $config['videos_dir'] . '/' . $base . '_thumb.' . $ext;
if (is_file($file)) return $config['public_videos'] . '/' . rawurlencode($base . '_thumb.' . $ext) . '?v=' . filemtime($file);
}
return '';
}