중복 탐지 범위 선택 추가 — 현재 폴더/소스 또는 전체

기존엔 항상 라이브러리 전체를 대상으로 했다. 이제 중복 검토 패널에서
현재 보고 있는 뷰(폴더=하위 포함 / 소스)로 범위를 좁힐 수 있고,
폴더/소스 뷰에서는 기본값이 '현재 위치'다. 전체/검색/태그/스마트 뷰는
전체 라이브러리로 고정.

- dedupe::Scope { All | Source | Folder{recursive} } 도입, load_files/run에 적용
  (folder_snapshot과 동일한 경로 프리픽스 스코핑)
- start_dedupe에 folder_id/recursive 파라미터 추가
- DedupePanel: view() 기반 범위 세그먼트 컨트롤
- 테스트: folder_scope_restricts_detection (folderA=1그룹, 전체=2그룹, 누출 없음)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
강 한
2026-07-19 19:57:40 +09:00
co-authored by Claude Fable 5
parent a734ba21b9
commit 8ba0c24ce8
5 changed files with 165 additions and 14 deletions
+10 -1
View File
@@ -1039,6 +1039,8 @@ pub fn start_dedupe(
app: tauri::AppHandle,
state: tauri::State<'_, AppState>,
source_id: Option<i64>,
folder_id: Option<i64>,
recursive: Option<bool>,
image_threshold: u32,
include_video: bool,
on_progress: Channel<DedupeProgress>,
@@ -1048,6 +1050,13 @@ pub fn start_dedupe(
}
state.dedupe_cancel.store(false, Ordering::SeqCst);
// 범위 결정: 폴더 > 소스 > 전체 (folder_snapshot과 동일 우선순위)
let scope = match (folder_id, source_id) {
(Some(fid), _) => dedupe::Scope::Folder { id: fid, recursive: recursive.unwrap_or(true) },
(None, Some(sid)) => dedupe::Scope::Source(sid),
(None, None) => dedupe::Scope::All,
};
let db = state.db.clone();
let tools = state.tools.clone();
let cancel = state.dedupe_cancel.clone();
@@ -1059,7 +1068,7 @@ pub fn start_dedupe(
let result = dedupe::run(
&db,
tools.as_ref(),
source_id,
scope,
image_threshold,
include_video,
&cancel,