v1.4.7: 类型文案全面去「张」——注册表驱动 countLabel/typeCountsOf,补 design/other 类型行,统计图例按注册表顺序展示

This commit is contained in:
jinghui committed 2026-11-18 22:30:57 +08:00
1 parent 58900d0d45
commit c59791f994
16 files changed
+215 -40

No files matched your search

+13 -1
View File
@@ -112,9 +112,21 @@ class ImageService {
ORDER BY count DESC
`).all();
// 按文件类型分组计数(image/video/document/...),供前端类型注册表自动识别渲染
const typeCountsList = db.db.prepare(`
SELECT file_type, COUNT(*) as count
FROM images
GROUP BY file_type
`).all();
const typeCounts = {};
for (const row of typeCountsList) {
typeCounts[row.file_type || 'image'] = row.count;
}
return {
...stats,
formats: formatStats
formats: formatStats,
typeCounts
};
} finally {
this.dbPool.release(library.path);