diff --git a/karaokatalog/organize/move.py b/karaokatalog/organize/move.py index 1977853..9be26de 100644 --- a/karaokatalog/organize/move.py +++ b/karaokatalog/organize/move.py @@ -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) )