When the mover returns MoveOutcome::Merged (destination already exists, source deleted), approve_and_finalize was checking only file_hash to detect duplicates. Since the second ingestion had a different hash (different quality/mastering), it bypassed the check and created a phantom track record pointing to an existing storage_path with the wrong hash (of the now-deleted source file). Added a second dedup check by storage_path: if a non-hidden track already exists at that path, mark pending as 'merged' instead of inserting a new track row. This prevents phantom entries for any subsequent ingestion of a different-quality version of an already stored file. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
40 KiB
40 KiB