diff --git a/themes/beauty/controller/CommandController.php b/themes/beauty/controller/CommandController.php index 35c8174..c19fde4 100644 --- a/themes/beauty/controller/CommandController.php +++ b/themes/beauty/controller/CommandController.php @@ -156,6 +156,9 @@ eof; $scanner->setWebRoot(FSC::$app['config']['content_directory']); $scanner->setRootDir($dirpath); + //尝试使用exiftool来获取视频的拍摄时间 + $scanner->exiftoolSupported = true; + $maxScanDeep = 0; //最大扫描目录级数 $dirTree = $scanner->scan($dirpath, $maxScanDeep); $scanResults = $scanner->getScanResults(); diff --git a/themes/beauty/controller/ListController.php b/themes/beauty/controller/ListController.php index 79f2de9..35e9c07 100644 --- a/themes/beauty/controller/ListController.php +++ b/themes/beauty/controller/ListController.php @@ -8,6 +8,8 @@ require_once __DIR__ . '/../../../plugins/Common.php'; require_once __DIR__ . '/../../../plugins/Html.php'; Class ListController extends Controller { + protected $dateIndexCacheKey = 'MainBotDateIndex'; + protected $noOriginalCtimeFilesCacheKey = 'MainBotNoOriginalCtimeFiles'; public function actionIndex() { $cateId = $this->get('id', ''); @@ -300,10 +302,14 @@ Class ListController extends Controller { $isAdminIp = Common::isAdminIp($this->getUserIp()); //判断是否拥有管理权限 + //从缓存文件获取按年份、月份归类的索引数据 + $cacheDataByDate = Common::getCacheFromFile($this->dateIndexCacheKey, 86400*365); + $viewName = '//site/index'; //共享视图 $params = compact( 'cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'breadcrumbs', 'htmlCateReadme', - 'mp3File', 'page', 'pageSize', 'cacheDataId', 'copyright', 'showType', 'isAdminIp', 'allFiles' + 'mp3File', 'page', 'pageSize', 'cacheDataId', 'copyright', 'showType', 'isAdminIp', 'allFiles', + 'cacheDataByDate' ); return $this->render($viewName, $params, $pageTitle); } diff --git a/themes/beauty/controller/SiteController.php b/themes/beauty/controller/SiteController.php index a44e461..62f9088 100644 --- a/themes/beauty/controller/SiteController.php +++ b/themes/beauty/controller/SiteController.php @@ -261,7 +261,7 @@ Class SiteController extends Controller { //从缓存文件获取按年份、月份归类的索引数据 - $cacheDataByDate = Common::getCache($this->dateIndexCacheKey); + $cacheDataByDate = Common::getCacheFromFile($this->dateIndexCacheKey, 86400*365); $viewName = 'index'; $params = compact( diff --git a/themes/beauty/views/site/index.php b/themes/beauty/views/site/index.php index 95cf964..904fa25 100644 --- a/themes/beauty/views/site/index.php +++ b/themes/beauty/views/site/index.php @@ -61,15 +61,22 @@ $main_view_cls = $menu_ext_status == 'opened' ? '' : 'full';