Fix editing a replay twice with the same name (fixes #342)

This commit is contained in:
Jonas Herzig
2020-09-27 12:36:16 +02:00
parent e24c4cd860
commit f42f4d468d

View File

@@ -120,6 +120,9 @@ public class MarkerProcessor {
squashFilter.init(studio, null); squashFilter.init(studio, null);
Path inputPath = path.resolveSibling("raw").resolve(path.getFileName()); Path inputPath = path.resolveSibling("raw").resolve(path.getFileName());
for (int i = 1; Files.exists(inputPath); i++) {
inputPath = inputPath.resolveSibling(replayName + "." + i + ".mcpr");
}
Files.createDirectories(inputPath.getParent()); Files.createDirectories(inputPath.getParent());
Files.move(path, inputPath); Files.move(path, inputPath);