Skip to content
This repository has been archived by the owner on May 21, 2020. It is now read-only.

Commit

Permalink
Fix a bug in us game grabber
Browse files Browse the repository at this point in the history
  • Loading branch information
Dounx committed Apr 5, 2018
1 parent 6fcaf95 commit abc9e28
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "me.dounx.nintendoeshophelper"
minSdkVersion 21
targetSdkVersion 27
versionCode 10
versionName "1.1.8"
versionCode 11
versionName "1.1.9"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Binary file modified app/src/main/assets/GameBase.db
Binary file not shown.
13 changes: 1 addition & 12 deletions app/src/main/java/GameGrabber/USGameGrabTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected Integer doInBackground(String... params) {
.addPathSegment("game")
.addQueryParameter("system", "switch")
.addQueryParameter("sort", "title")
.addQueryParameter("direction", "asc")
.addQueryParameter("direction", "c")
.addQueryParameter("shop", "ncom")
.addQueryParameter("limit", Integer.toString(LIMIT))
.addQueryParameter("offset", Integer.toString(offset))
Expand Down Expand Up @@ -91,16 +91,6 @@ private int parseJsonWithJSONObjectAndAddToDB(String jsonData) {
try {
JSONObject jsonObject = new JSONObject(jsonData);

JSONObject filterObject = jsonObject.getJSONObject("filter");
JSONObject systemsObject = filterObject.getJSONObject("systems");
int gameCount = systemsObject.getJSONArray("system").getJSONObject(7).getInt("total");

try (USGameCursorWrapper cursor = queryUSGames(null, null )) {
if (cursor.getCount() == gameCount) {
return 0;
}
}

JSONObject gamesObject = jsonObject.getJSONObject("games");

if (gamesObject.has("game")) { // Last time may not have game array
Expand Down Expand Up @@ -151,7 +141,6 @@ private int parseJsonWithJSONObjectAndAddToDB(String jsonData) {
addUSGame(usGame);
}
}
return gameCount;
} catch (Exception e) {
e.printStackTrace();
}
Expand Down

0 comments on commit abc9e28

Please sign in to comment.