This should fix the Issues.

Also: Don't do anything when pressed `A` on folders.
This commit is contained in:
VoltZ
2019-11-06 17:03:59 +01:00
parent d8531aa1fd
commit f702a94573
2 changed files with 12 additions and 3 deletions
+9 -1
View File
@@ -132,8 +132,16 @@ void ScriptBrowse::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
if (hDown & KEY_A) {
if (jsonFileBrowse.size() != 0) {
std::string fileName = Lang::get("DOWNLOADING") + std::string(jsonFileBrowse[selection]["title"]);
std::string titleFix = jsonFileBrowse[selection]["title"];
for (int i = 0; i < (int)titleFix.size(); i++) {
if (titleFix[i] == '/') {
titleFix[i] = '-';
}
}
DisplayMsg(fileName);
downloadToFile(jsonFileBrowse[selection]["url"], Config::ScriptPath + std::string(jsonFileBrowse[selection]["title"])+ ".json");
downloadToFile(jsonFileBrowse[selection]["url"], Config::ScriptPath + titleFix + ".json");
}
}