feat(core): 优化媒体文件扫描和处理功能

- 添加跳过ffprobe相关文件的逻辑,避免处理临时释放文件
- 修复图片处理中的变量引用错误
- 实现大文件指纹复用机制,避免重复全量读取计算MD5
- 新增文件头尾采样指纹算法,提升大文件处理性能
- 重构ffprobe内嵌资源管理,支持多平台自动选择对应版本
- 添加媒体信息数据库的指纹索引和去向跟踪功能
- 优化程序启动流程,失败时跳过媒体整理但保留图片处理
- 更新文档说明多平台ffprobe支持和构建要求
This commit is contained in:
2025-03-21 21:00:59 +08:00
parent b276e8c56f
commit 066e28a2d6
16 changed files with 156 additions and 45 deletions
BIN
View File
Binary file not shown.
+8
View File
@@ -0,0 +1,8 @@
//go:build darwin
package vars
import _ "embed"
//go:embed bin/ffprobe_mac
var VideoDecodeTool []byte // 需在 vars/bin/ 下放置 macOS 版 ffprobe(未入库,见 .gitignore)
+6
View File
@@ -0,0 +1,6 @@
//go:build !darwin && !windows
package vars
// VideoDecodeTool 当前平台没有内嵌的ffprobe
var VideoDecodeTool []byte
+8
View File
@@ -0,0 +1,8 @@
//go:build windows
package vars
import _ "embed"
//go:embed bin/ffprobe.exe
var VideoDecodeTool []byte // 需在 vars/bin/ 下放置 Windows 版 ffprobe(未入库,见 .gitignore)
+1
View File
@@ -8,3 +8,4 @@ var GlobalImagePathList []string // 所有图片文件
var GlobalMediaPathList []string // 待ffprobe确认的媒体候选文件
var GlobalAudioPathList []string // 已确认的音频文件路径
var GlobalPickerDir string // 已整理文件的输出目录(白名单,扫描时跳过)
var GlobalPath2DestDirMap = make(map[string]string) // 文件路径 → 移动到的目录(去向)
-6
View File
@@ -1,11 +1,5 @@
package vars
import (
_ "embed" // 内嵌文件支持
)
//go:embed ffprobe.exe
var VideoDecodeToolWin64 []byte
var VideoIgnorePathList []string // 忽略的文件路径
var VideoReadErrorPathList []string // 读取信息异常的路径
var VideoPath2WidthHeightMap = make(map[string]string) // 视频路径和宽高比