diff --git a/include/gamefile.h b/include/gamefile.h index e314046..3c6ddd4 100644 --- a/include/gamefile.h +++ b/include/gamefile.h @@ -32,6 +32,7 @@ class gameFile std::string path; std::string size; std::string galaxy_downlink_json_url; + std::string version; unsigned int platform; unsigned int language; unsigned int type; diff --git a/include/globalconstants.h b/include/globalconstants.h index 6ba040c..11beb7f 100644 --- a/include/globalconstants.h +++ b/include/globalconstants.h @@ -12,7 +12,7 @@ namespace GlobalConstants { - const int GAMEDETAILS_CACHE_VERSION = 3; + const int GAMEDETAILS_CACHE_VERSION = 4; const int ZLIB_WINDOW_SIZE = 15; struct optionsStruct {const unsigned int id; const std::string code; const std::string str; const std::string regexp;}; diff --git a/src/downloader.cpp b/src/downloader.cpp index bc66cd1..9d42b9a 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -510,6 +510,7 @@ int Downloader::listGames() << "\tsize: " << games[i].installers[j].size << std::endl << "\tupdated: " << (games[i].installers[j].updated ? "True" : "False") << std::endl << "\tlanguage: " << languages << std::endl + << "\tversion: " << games[i].installers[j].version << std::endl << std::endl; } } @@ -556,6 +557,7 @@ int Downloader::listGames() << "\tsize: " << games[i].patches[j].size << std::endl << "\tupdated: " << (games[i].patches[j].updated ? "True" : "False") << std::endl << "\tlanguage: " << languages << std::endl + << "\tversion: " << games[i].patches[j].version << std::endl << std::endl; } } @@ -608,6 +610,7 @@ int Downloader::listGames() << "\tpath: " << games[i].dlcs[j].installers[k].path << std::endl << "\tsize: " << games[i].dlcs[j].installers[k].size << std::endl << "\tupdated: " << (games[i].dlcs[j].installers[k].updated ? "True" : "False") << std::endl + << "\tversion: " << games[i].dlcs[j].installers[k].version << std::endl << std::endl; } for (unsigned int k = 0; k < games[i].dlcs[j].patches.size(); ++k) @@ -625,6 +628,7 @@ int Downloader::listGames() << "\tname: " << games[i].dlcs[j].patches[k].name << std::endl << "\tpath: " << games[i].dlcs[j].patches[k].path << std::endl << "\tsize: " << games[i].dlcs[j].patches[k].size << std::endl + << "\tversion: " << games[i].dlcs[j].patches[k].version << std::endl << std::endl; } for (unsigned int k = 0; k < games[i].dlcs[j].extras.size(); ++k) @@ -2162,6 +2166,8 @@ std::vector Downloader::getGameDetailsFromJsonNode(Json::Value root fileDetails.gamename = fileDetailsNode["gamename"].asString(); fileDetails.type = fileDetailsNode["type"].asUInt(); fileDetails.galaxy_downlink_json_url = fileDetailsNode["galaxy_downlink_json_url"].asString(); + if (!fileDetailsNode["version"].empty()) + fileDetails.version = fileDetailsNode["version"].asString(); if (nodeName != "extras" && !(fileDetails.platform & conf.dlConf.iInstallerPlatform)) continue; diff --git a/src/galaxyapi.cpp b/src/galaxyapi.cpp index defb25f..e0e5921 100644 --- a/src/galaxyapi.cpp +++ b/src/galaxyapi.cpp @@ -332,6 +332,9 @@ std::vector galaxyAPI::fileJsonNodeToGameFileVector(const std::string& Json::Value infoNode = json[i]; unsigned int iFiles = infoNode["files"].size(); std::string name = infoNode["name"].asString(); + std::string version = ""; + if (!infoNode["version"].empty()) + version = infoNode["version"].asString(); unsigned int iPlatform = GlobalConstants::PLATFORM_WINDOWS; unsigned int iLanguage = GlobalConstants::LANGUAGE_EN; @@ -368,6 +371,7 @@ std::vector galaxyAPI::fileJsonNodeToGameFileVector(const std::string& gf.size = Util::getJsonUIntValueAsString(fileNode["size"]); gf.updated = 0; // assume not updated gf.galaxy_downlink_json_url = downlink; + gf.version = version; if (!(type & GFTYPE_EXTRA)) { diff --git a/src/gamefile.cpp b/src/gamefile.cpp index a8a1e54..4264ce8 100644 --- a/src/gamefile.cpp +++ b/src/gamefile.cpp @@ -12,6 +12,7 @@ gameFile::gameFile() this->language = GlobalConstants::LANGUAGE_EN; this->silent = 0; this->type = 0; + this->version = ""; } gameFile::~gameFile() @@ -44,6 +45,8 @@ Json::Value gameFile::getAsJson() json["gamename"] = this->gamename; json["type"] = this->type; json["galaxy_downlink_json_url"] = this->galaxy_downlink_json_url; + if (!this->version.empty()) + json["version"] = this->version; return json; }