fix: pHash dedup 後刪除孤立 scene jpg(jpg 數 = scenes 數)
根因: 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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user