Don't generate no-ops

This commit is contained in:
Jakob Moser 2025-06-01 14:46:49 +02:00
parent b5649a349b
commit df5fc37419
Signed by: jakob
GPG Key ID: 3EF2BA2851B3F53C

View File

@ -62,6 +62,12 @@ def move(songs: Sequence[Song], base_dir: Path) -> Sequence[MoveInstruction]:
variant += 1
song_dir_strs_lower.add(str(canonical_song_dir).lower())
if song_dir == canonical_song_dir:
# After finding a free variant index, we arrived at the index we already had previously, this means
# we do not need to generate a move instruction
continue
move_instructions.append(
MoveInstruction(absolute_song_dir, base_dir / canonical_song_dir)
)