Android: Have non-games use their filename as a Game ID.
This commit is contained in:
parent
f75b1024aa
commit
2bdf6537c8
|
@ -188,12 +188,20 @@ public final class GameDatabase extends SQLiteOpenHelper
|
||||||
name = filePath.substring(filePath.lastIndexOf("/") + 1);
|
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),
|
ContentValues game = Game.asContentValues(NativeLibrary.GetPlatform(filePath),
|
||||||
name,
|
name,
|
||||||
NativeLibrary.GetDescription(filePath).replace("\n", " "),
|
NativeLibrary.GetDescription(filePath).replace("\n", " "),
|
||||||
NativeLibrary.GetCountry(filePath),
|
NativeLibrary.GetCountry(filePath),
|
||||||
filePath,
|
filePath,
|
||||||
NativeLibrary.GetGameId(filePath),
|
gameId,
|
||||||
NativeLibrary.GetCompany(filePath));
|
NativeLibrary.GetCompany(filePath));
|
||||||
|
|
||||||
// Try to update an existing game first.
|
// Try to update an existing game first.
|
||||||
|
|
Loading…
Reference in New Issue