beets/beets/importer
Axel Wikström b5d8ced9d9 Enable duplicate detection for as-is imports
When importing with autotag=no, duplicate detection was skipped entirely
because the import_asis stage called _apply_choice() directly without
first calling _resolve_duplicates(). This meant the duplicate_keys and
duplicate_action config options were ignored for as-is imports.

This was a known limitation documented by a FIXME comment added in
commit 79d1203541 (Sep 2014): "We should also resolve duplicates when
not autotagging." The FIXME was later removed during a comment cleanup
(f145e3b18) but the issue was never addressed.

This commit adds the _resolve_duplicates() call to import_asis, ensuring
duplicate detection works consistently regardless of the autotag setting.
This applies to both album imports and singleton imports.

Test changes:
- Renamed test_no_autotag_keeps_duplicate_album to
  test_no_autotag_removes_duplicate_album to verify the corrected behavior
- Added test_no_autotag_removes_duplicate_singleton to verify singleton
  duplicate detection also works with autotag=no

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 14:26:13 +00:00
..
__init__.py Enable RUF rules 2026-01-13 20:55:40 +00:00
session.py Configure future-annotations 2026-01-13 20:55:40 +00:00
stages.py Enable duplicate detection for as-is imports 2026-03-04 14:26:13 +00:00
state.py Do not use explicit indices for logging args when not needed 2025-08-30 23:10:21 +01:00
tasks.py Fix crash in task.imported_items 2026-01-31 23:48:43 +00:00