Show installer and patch version when listing game details

This commit is contained in:
Sude 2020-11-27 21:46:12 +02:00
parent 26315b23b8
commit fe7fad300b
5 changed files with 15 additions and 1 deletions

View File

@ -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;

View File

@ -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;};

View File

@ -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<gameDetails> 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;

View File

@ -332,6 +332,9 @@ std::vector<gameFile> 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<gameFile> 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))
{

View File

@ -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;
}