|
|
|
@ -129,6 +129,9 @@ eof;
@@ -129,6 +129,9 @@ eof;
|
|
|
|
|
//缓存所有文件id跟文件信息,便于根据id列表来渲染,并按id首字母分子目录存放,以支持大量文件的场景 |
|
|
|
|
$this->saveAllFilesIntoCacheFile(); |
|
|
|
|
|
|
|
|
|
//TODO: 保存所有目录下文件数量统计 |
|
|
|
|
//按年、月保存文件数据,以便按年、月显示 |
|
|
|
|
|
|
|
|
|
//while (true) { |
|
|
|
|
//$time = date('Y-m-d H:i:s'); |
|
|
|
|
//echo "{$botLogPrefix} {$time}\n"; |
|
|
|
@ -142,6 +145,7 @@ eof;
@@ -142,6 +145,7 @@ eof;
|
|
|
|
|
Common::setCache($this->scanedDirCacheKey, array()); |
|
|
|
|
Common::setCache($this->dateIndexCacheKey, array()); |
|
|
|
|
Common::setCache($this->noOriginalCtimeFilesCacheKey, array()); |
|
|
|
|
Common::setCache($this->allFilesCacheKey, array()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//扫描媒体文件:图片、视频、音乐 |
|
|
|
@ -227,6 +231,7 @@ eof;
@@ -227,6 +231,7 @@ eof;
|
|
|
|
|
'total' => $total, |
|
|
|
|
'current' => $index, |
|
|
|
|
'percent' => floor($index*100/$total), |
|
|
|
|
'status' => 'running', |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$botLogPrefix = $this->logPrefix; |
|
|
|
@ -238,6 +243,10 @@ eof;
@@ -238,6 +243,10 @@ eof;
|
|
|
|
|
|
|
|
|
|
$rootDir = __DIR__ . '/../../../www/' . FSC::$app['config']['content_directory']; |
|
|
|
|
if ($dirpath == $rootDir) { |
|
|
|
|
if ($index == $total) { |
|
|
|
|
$stats['status'] = 'finished'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
echo "{$botLogPrefix} Scan has finished {$stats['percent']}%, total {$stats['total']}, current {$stats['current']}\n"; |
|
|
|
|
|
|
|
|
|
//保存进度文件 |
|
|
|
|