Enable duplicate detection for as-is (autotag: no) imports #6280
+41
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When importing with
autotag: no, duplicate detection is completely bypassed. Theimport_asisstage calls_apply_choice()directly without first calling_resolve_duplicates(), meaning any configuredduplicate_keysandduplicate_actionsettings are ignored.This was a known limitation. Commit 79d1203 (Sep 2014) added a FIXME comment:
The FIXME was removed during a comment cleanup in f145e3b (Jan 2015), but the underlying issue was never fixed. A test
test_no_autotag_keeps_duplicate_albumwas added to document the existing behavior at the time.The Fix
Add
_resolve_duplicates(session, task)to theimport_asisstage before_apply_choice(), matching the behavior of theuser_querystage used when autotagging.Test Changes
test_no_autotag_keeps_duplicate_album→test_no_autotag_removes_duplicate_albumimport_file.save()callTo Do
Documentation(Bugfix for existing documented config options)