From 247a20b2dbe675915c3f0b13cea4a37d91afbd14 Mon Sep 17 00:00:00 2001 From: lantzelot-swe <75668734+lantzelot-swe@users.noreply.github.com> Date: Mon, 3 Jan 2022 11:56:06 +0100 Subject: [PATCH] fix: fix how the file ending is identified when adding a game, takes last index of "." instead of first. --- src/main/java/se/lantz/model/InfoModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/se/lantz/model/InfoModel.java b/src/main/java/se/lantz/model/InfoModel.java index 5237c99..9095c65 100644 --- a/src/main/java/se/lantz/model/InfoModel.java +++ b/src/main/java/se/lantz/model/InfoModel.java @@ -350,7 +350,7 @@ public class InfoModel extends AbstractModel this.gamesPath = file.toPath(); //Set games name, always add ".gz"?? 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())) {