Skip to content

Commit

Permalink
Shared - Fix Saving New Path
Browse files Browse the repository at this point in the history
  • Loading branch information
nlogozzo committed Nov 5, 2023
1 parent 86972c9 commit 155ef30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion NickvisionTagger.Shared/Models/MusicFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,8 @@ public bool SaveTagToDisk(bool preserveModificationTimestamp)
var i = 1;
while (File.Exists(newPath))
{
newPath = newPath.Remove(newPath.IndexOf($" ({i - 1})")) + $" ({i})";
var oldNumber = $" ({i - 1})";
newPath = newPath.Remove(newPath.IndexOf(oldNumber), oldNumber.Length) + $" ({i})";
}
File.Move(Path, newPath);
Path = newPath;
Expand Down

0 comments on commit 155ef30

Please sign in to comment.