fix: pHash dedup 後刪除孤立 scene jpg(jpg 數 = scenes 數)
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled

根因: extract_scene_frames 先寫出全部 jpg,pHash dedup 後只調整
profile.scenes,但被移除 scene 的 jpg 沒刪除 → 磁碟 5 張 jpg
但 scenes.json 只有 4 個 scene(如 1c6f40 scene_003.jpg 孤立)。

修復: dedup 時對被移除的 scene 呼叫 std::fs::remove_file 刪除 jpg。
已清理 1c6f40 的孤立 scene_003.jpg。
This commit is contained in:
Accusys
2026-11-19 19:18:17 +08:00
parent 797f4c61f6
commit 36fc4d0360
+5
View File
@@ -5728,6 +5728,11 @@ async fn process_job(&self, job: crate::core::db::MonitorJob) -> Result<()> {
if keep_set.contains(&i) {
new_scenes.push(scene);
new_extracted.push(path);
} else {
// Remove the now-orphaned scene jpg so disk matches scenes.json.
if let Err(e) = std::fs::remove_file(&path) {
debug!("[DEDUP] failed to remove orphan scene jpg {:?}: {}", path, e);
}
}
}
profile.scenes = new_scenes;