fix: fix how the file ending is identified when adding a game, takes last index of "." instead of first.

This commit is contained in:
lantzelot-swe 2022-01-03 11:56:06 +01:00
parent e28e9e51fb
commit 247a20b2db
1 changed files with 1 additions and 1 deletions

View File

@ -350,7 +350,7 @@ public class InfoModel extends AbstractModel
this.gamesPath = file.toPath(); this.gamesPath = file.toPath();
//Set games name, always add ".gz"?? //Set games name, always add ".gz"??
String fileName = FileManager.generateFileNameFromTitle(this.title, getDuplicateIndex()); String fileName = FileManager.generateFileNameFromTitle(this.title, getDuplicateIndex());
String fileEnding = file.getName().substring(file.getName().indexOf(".")); String fileEnding = file.getName().substring(file.getName().lastIndexOf("."));
if (FileManager.shouldCompressFile(file.getName())) if (FileManager.shouldCompressFile(file.getName()))
{ {