Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
fennectech committed May 16, 2020
1 parent 68a93f5 commit 08de45b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions source/scenes/AppUpdateScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,19 @@ namespace ku::scenes {
if (request == _appVersionRequest) {
json_t * root = json_loads(request->response.rawResponseBody.c_str(), 0, NULL);
if (!root || !json_is_array(root) || json_array_size(root) < 1) {
_showStatus("Unable to parse response from GitHub API.", "Please restart the app to try again.");
_showStatus("Unable to parse response from GitHub API.", "Please restart the app to try again.[4]");
return;
}

json_t * release = json_array_get(root, 0);
if (!release || !json_is_object(release)) {
_showStatus("Unable to parse response from GitHub API.", "Please restart the app to try again.");
_showStatus("Unable to parse response from GitHub API.", "Please restart the app to try again.[5]");
return;
}

json_t * tagName = json_object_get(release, "tag_name");
if (!tagName || !json_is_string(tagName)) {
_showStatus("Unable to parse response from GitHub API.", "Please restart the app to try again.");
_showStatus("Unable to parse response from GitHub API.", "Please restart the app to try again.[6]");
return;
}

Expand Down
10 changes: 5 additions & 5 deletions source/scenes/PackageDownloadScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,21 @@ namespace ku::scenes {
json_decref(root);
}

_showStatus("Unable to parse response from GitHub API.", "Please restart the app to try again.", false);
_showStatus("Unable to parse response from GitHub API.", "Please restart the app to try again.[7]", false);
return;
}

json_t * release = json_array_get(root, 0);
if (!release || !json_is_object(release)) {
json_decref(root);
_showStatus("Unable to parse response from GitHub API.", "Please restart the app to try again.", false);
_showStatus("Unable to parse response from GitHub API.", "Please restart the app to try again.[8]", false);
return;
}

json_t * tagName = json_object_get(release, "tag_name");
if (!tagName || !json_is_string(tagName)) {
json_decref(root);
_showStatus("Unable to parse response from GitHub API.", "Please restart the app to try again.", false);
_showStatus("Unable to parse response from GitHub API.", "Please restart the app to try again.[9]", false);
return;
}

Expand All @@ -169,7 +169,7 @@ namespace ku::scenes {
json_t * assets = json_object_get(release, "assets");
if (!assets || !json_is_array(assets) || json_array_size(assets) < 1) {
json_decref(root);
_showStatus("Unable to parse response from GitHub API.", "Please restart the app to try again.", false);
_showStatus("Unable to parse response from GitHub API.", "Please restart the app to try again.[10]", false);
return;
}

Expand All @@ -186,7 +186,7 @@ namespace ku::scenes {
}

std::string assetName(json_string_value(name));
if (assetName.compare(0, 6, "DeepSea") != 0 || assetName.compare(assetName.length() - 4, 4, ".zip") != 0) {
if (assetName.compare(0, 8, "deepsea_") != 0 || assetName.compare(assetName.length() - 4, 4, ".zip") != 0) {
continue;
}

Expand Down
6 changes: 3 additions & 3 deletions source/scenes/PackageSelectScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,19 @@ namespace ku::scenes {
void PackageSelectScene::_onCompleted(WebRequest * request) {
json_t * root = json_loads(request->response.rawResponseBody.c_str(), 0, NULL);
if (!root || !json_is_array(root) || json_array_size(root) < 1) {
_showStatusView("Unable to parse response from GitHub API.", "Please restart the app to try again.");
_showStatusView("Unable to parse response from GitHub API.", "Please restart the app to try again.[1]");
return;
}

json_t * release = json_array_get(root, 0);
if (!release || !json_is_object(release)) {
_showStatusView("Unable to parse response from GitHub API.", "Please restart the app to try again.");
_showStatusView("Unable to parse response from GitHub API.", "Please restart the app to try again.[2]");
return;
}

json_t * tagName = json_object_get(release, "tag_name");
if (!tagName || !json_is_string(tagName)) {
_showStatusView("Unable to parse response from GitHub API.", "Please restart the app to try again.");
_showStatusView("Unable to parse response from GitHub API.", "Please restart the app to try again.[3]");
return;
}

Expand Down

0 comments on commit 08de45b

Please sign in to comment.