Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.

Commit 33ff82c

Browse files
Fix min files not being deleted if larger than original.
1 parent 9d749af commit 33ff82c

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

app/src/main/java/com/spse/javamodsoptimiser/asynctask/SoundOptimizer.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ public Void doInBackground(Void[] voids){
6060

6161
try {
6262
if (compareFileSize(oggPath, minOggPath)) {
63-
removeFile(mod.getSoundPath(i));
64-
renameFile(mod.getSoundPath(i).concat("-min.ogg"), mod.getSoundPath(i));
63+
removeFile(oggPath);
64+
renameFile(minOggPath, oggPath);
65+
}else{
66+
removeFile(minOggPath);
6567
}
6668
} catch (IOException e) {
6769
e.printStackTrace();

app/src/main/java/com/spse/javamodsoptimiser/asynctask/TextureOptimizer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ protected Void doInBackground(Void[] voids){
6262
if (compareFileSize(mod.getTexturePath(i), mod.getTexturePath(i).concat("-min.png"))) {
6363
removeFile(mod.getTexturePath(i));
6464
renameFile(mod.getTexturePath(i).concat("-min.png"), mod.getTexturePath(i));
65+
}else{
66+
removeFile(mod.getTexturePath(i).concat("-min.png"));
6567
}
6668
} catch (IOException e) {
6769
e.printStackTrace();

0 commit comments

Comments
 (0)