Browse Source

bug fix for no data dirs

master
filesite 4 months ago
parent
commit
2c2afddbbe
  1. 4
      themes/beauty/controller/ListController.php

4
themes/beauty/controller/ListController.php

@ -105,12 +105,12 @@ Class ListController extends Controller {
//图片、视频类型筛选支持 //图片、视频类型筛选支持
$showType = $this->get('show', 'all'); $showType = $this->get('show', 'all');
if ($showType == 'image') { if ($showType == 'image' && !empty($scanResults[$cateId]['files'])) {
$scanResults[$cateId]['files'] = array_filter($scanResults[$cateId]['files'], function($item) { $scanResults[$cateId]['files'] = array_filter($scanResults[$cateId]['files'], function($item) {
$imgExts = !empty(FSC::$app['config']['supportedImageExts']) ? FSC::$app['config']['supportedImageExts'] : array('jpg', 'jpeg', 'png', 'webp', 'gif'); $imgExts = !empty(FSC::$app['config']['supportedImageExts']) ? FSC::$app['config']['supportedImageExts'] : array('jpg', 'jpeg', 'png', 'webp', 'gif');
return in_array($item['extension'], $imgExts); return in_array($item['extension'], $imgExts);
}); });
}else if ($showType == 'video') { }else if ($showType == 'video' && !empty($scanResults[$cateId]['files'])) {
$scanResults[$cateId]['files'] = array_filter($scanResults[$cateId]['files'], function($item) { $scanResults[$cateId]['files'] = array_filter($scanResults[$cateId]['files'], function($item) {
$videoExts = !empty(FSC::$app['config']['supportedVideoExts']) ? FSC::$app['config']['supportedVideoExts'] : array('mp4', 'mov', 'm3u8'); $videoExts = !empty(FSC::$app['config']['supportedVideoExts']) ? FSC::$app['config']['supportedVideoExts'] : array('mp4', 'mov', 'm3u8');
return in_array($item['extension'], $videoExts); return in_array($item['extension'], $videoExts);

Loading…
Cancel
Save