summaryrefslogtreecommitdiff
path: root/Source/Android/app/src/main/java
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2015-06-21 15:06:49 -0500
committerRyan Houdek <Sonicadvance1@gmail.com>2015-06-21 15:06:49 -0500
commit3f0f3c36fa5e56a937a8879980a1d5a3e5c3dbd9 (patch)
treefb7dfd8d3f3bdb35e255cb49a5abf9b9a9c3de0b /Source/Android/app/src/main/java
parentf6d27a5ce86af2c319cc51f5cc09ec8f15f41d3e (diff)
parent2bdf6537c80d94287b614b8e979407b0d7b3441a (diff)
Merge pull request #2627 from sigmabeta/android-non-games
Android: Have non-games use their filename as a Game ID.
Diffstat (limited to 'Source/Android/app/src/main/java')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameDatabase.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameDatabase.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameDatabase.java
index 6604717d92..28ef08f32e 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameDatabase.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameDatabase.java
@@ -188,12 +188,20 @@ public final class GameDatabase extends SQLiteOpenHelper
name = filePath.substring(filePath.lastIndexOf("/") + 1);
}
+ String gameId = NativeLibrary.GetGameId(filePath);
+
+ // If the game's ID field is empty, use the filename without extension.
+ if (gameId.isEmpty())
+ {
+ gameId = filePath.substring(filePath.lastIndexOf("/") + 1, filePath.lastIndexOf("."));
+ }
+
ContentValues game = Game.asContentValues(NativeLibrary.GetPlatform(filePath),
name,
NativeLibrary.GetDescription(filePath).replace("\n", " "),
NativeLibrary.GetCountry(filePath),
filePath,
- NativeLibrary.GetGameId(filePath),
+ gameId,
NativeLibrary.GetCompany(filePath));
// Try to update an existing game first.