Smarter keeper selection: folder-name + mtime signals

Adds a path-penalty score that downranks files in folders named Trashed,
Dups, Backup, Copy, Old, Archive, plus a penalty for repeated path segments
(e.g. Desktop/Desktop/Files) and very deep paths. Also captures and uses
file mtime as a tiebreaker — older files are usually the originals.

Applied to all four detection passes (sha256, phash, exif, filesize+dim)
and to auto-resolve-exact.

New file_mtime column with idempotent migration.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Carlos
2026-04-24 10:56:52 -04:00
parent 4d57b0af74
commit 14c6012808
3 changed files with 74 additions and 16 deletions

View File

@@ -490,7 +490,8 @@ def auto_resolve_exact():
for gid in groups:
cur.execute("""
SELECT f.id, f.width, f.height, f.file_size, f.exif_datetime
SELECT f.id, f.path, f.width, f.height, f.file_size,
f.exif_datetime, f.file_mtime
FROM duplicate_members dm
JOIN files f ON f.id = dm.file_id
WHERE dm.group_id = ?