diff --git a/include/config.h b/include/config.h index 1663098..b35806f 100644 --- a/include/config.h +++ b/include/config.h @@ -46,7 +46,7 @@ struct DownloadConfig bool bRemoteXML; bool bSaveChangelogs; bool bSaveSerials; - bool bSaveApiJson; + bool bSaveGameDetailsJson; bool bSaveLogo; bool bSaveIcon; bool bAutomaticXMLCreation; diff --git a/include/downloader.h b/include/downloader.h index 5a072c5..c4c11a5 100644 --- a/include/downloader.h +++ b/include/downloader.h @@ -148,7 +148,7 @@ class Downloader static std::string getSerialsFromJSON(const Json::Value& json); void saveSerials(const std::string& serials, const std::string& filepath); static std::string getChangelogFromJSON(const Json::Value& json); - void saveApiJson(const std::string& json, const std::string& filepath); + void saveGameDetailsJson(const std::string& json, const std::string& filepath); void saveChangelog(const std::string& changelog, const std::string& filepath); static void processDownloadQueue(Config conf, const unsigned int& tid); static void processCloudSaveDownloadQueue(Config conf, const unsigned int& tid); diff --git a/include/gamedetails.h b/include/gamedetails.h index 954951c..29d1028 100644 --- a/include/gamedetails.h +++ b/include/gamedetails.h @@ -33,14 +33,14 @@ class gameDetails std::string serials; std::string changelog; std::string logo; - std::string apiJson; + std::string gameDetailsJson; void filterWithPriorities(const gameSpecificConfig& config); void makeFilepaths(const DirectoryConfig& config); std::string getSerialsFilepath(); std::string getLogoFilepath(); std::string getIconFilepath(); std::string getChangelogFilepath(); - std::string getApiJsonFilepath(); + std::string getGameDetailsJsonFilepath(); Json::Value getDetailsAsJson(); std::vector getGameFileVector(); std::vector getGameFileVectorFiltered(const unsigned int& iType); @@ -54,7 +54,7 @@ class gameDetails std::string logoFilepath; std::string iconFilepath; std::string changelogFilepath; - std::string apiJsonFilepath; + std::string gameDetailsJsonFilepath; }; #endif // GAMEDETAILS_H diff --git a/main.cpp b/main.cpp index 84775dd..dfb6544 100644 --- a/main.cpp +++ b/main.cpp @@ -261,7 +261,7 @@ int main(int argc, char *argv[]) ("use-cache", bpo::value(&Globals::globalConfig.bUseCache)->zero_tokens()->default_value(false), ("Use game details cache")) ("cache-valid", bpo::value(&Globals::globalConfig.iCacheValid)->default_value(2880), ("Set how long cached game details are valid (in minutes)\nDefault: 2880 minutes (48 hours)")) ("save-serials", bpo::value(&Globals::globalConfig.dlConf.bSaveSerials)->zero_tokens()->default_value(false), "Save serial numbers when downloading") - ("save-api-json", bpo::value(&Globals::globalConfig.dlConf.bSaveApiJson)->zero_tokens()->default_value(false), "Save game details JSON data AS-IS from the API to \"api.json\"") + ("save-game-details-json", bpo::value(&Globals::globalConfig.dlConf.bSaveGameDetailsJson)->zero_tokens()->default_value(false), "Save game details JSON data AS-IS to \"game-details.json\"") ("save-logo", bpo::value(&Globals::globalConfig.dlConf.bSaveLogo)->zero_tokens()->default_value(false), "Save logo when downloading") ("save-icon", bpo::value(&Globals::globalConfig.dlConf.bSaveIcon)->zero_tokens()->default_value(false), "Save icon when downloading") ("ignore-dlc-count", bpo::value(&Globals::globalConfig.sIgnoreDLCCountRegex)->implicit_value(".*"), "Set regular expression filter for games to ignore DLC count information\nIgnoring DLC count information helps in situations where the account page doesn't provide accurate information about DLCs") diff --git a/src/downloader.cpp b/src/downloader.cpp index 80fcaeb..093932d 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -707,10 +707,10 @@ void Downloader::download() this->saveChangelog(games[i].changelog, filepath); } - if (conf.dlConf.bSaveApiJson && !games[i].apiJson.empty()) + if (conf.dlConf.bSaveGameDetailsJson && !games[i].gameDetailsJson.empty()) { - std::string filepath = games[i].getApiJsonFilepath(); - this->saveApiJson(games[i].apiJson, filepath); + std::string filepath = games[i].getGameDetailsJsonFilepath(); + this->saveGameDetailsJson(games[i].gameDetailsJson, filepath); } if ((conf.dlConf.iInclude & GlobalConstants::GFTYPE_DLC) && !games[i].dlcs.empty()) @@ -2216,8 +2216,8 @@ void Downloader::updateCache() return; } -// Save API JSON to file -void Downloader::saveApiJson(const std::string& json, const std::string& filepath) +// Save game details JSON to file +void Downloader::saveGameDetailsJson(const std::string& json, const std::string& filepath) { // Get directory from filepath boost::filesystem::path pathname = filepath; @@ -2245,7 +2245,7 @@ void Downloader::saveApiJson(const std::string& json, const std::string& filepat std::ofstream ofs(filepath); if (ofs) { - std::cout << "Saving API JSON: " << filepath << std::endl; + std::cout << "Saving game details JSON: " << filepath << std::endl; ofs << json; ofs.close(); } @@ -3680,7 +3680,7 @@ void Downloader::getGameDetailsThread(Config config, const unsigned int& tid) if ((conf.dlConf.bSaveSerials && game.serials.empty()) || (conf.dlConf.bSaveChangelogs && game.changelog.empty()) - || (conf.dlConf.bSaveApiJson && game.apiJson.empty()) + || (conf.dlConf.bSaveGameDetailsJson && game.gameDetailsJson.empty()) ) { Json::Value gameDetailsJSON; @@ -3697,8 +3697,8 @@ void Downloader::getGameDetailsThread(Config config, const unsigned int& tid) if (conf.dlConf.bSaveChangelogs && game.changelog.empty()) game.changelog = Downloader::getChangelogFromJSON(gameDetailsJSON); - if (conf.dlConf.bSaveApiJson && game.apiJson.empty()) { - game.apiJson = gameDetailsJSON.toStyledString(); + if (conf.dlConf.bSaveGameDetailsJson && game.gameDetailsJson.empty()) { + game.gameDetailsJson = gameDetailsJSON.toStyledString(); } } diff --git a/src/gamedetails.cpp b/src/gamedetails.cpp index fb90422..8c91663 100644 --- a/src/gamedetails.cpp +++ b/src/gamedetails.cpp @@ -95,7 +95,7 @@ void gameDetails::makeFilepaths(const DirectoryConfig& config) this->logoFilepath = Util::makeFilepath(directory, "logo" + logo_ext, this->gamename, subdir, 0); this->iconFilepath = Util::makeFilepath(directory, "icon" + icon_ext, this->gamename, subdir, 0); this->changelogFilepath = Util::makeFilepath(directory, "changelog_" + gamename + ".html", this->gamename, subdir, 0); - this->apiJsonFilepath = Util::makeFilepath(directory, "api.json", this->gamename, subdir, 0); + this->gameDetailsJsonFilepath = Util::makeFilepath(directory, "game-details.json", this->gamename, subdir, 0); for (unsigned int i = 0; i < this->installers.size(); ++i) { @@ -213,9 +213,9 @@ std::string gameDetails::getChangelogFilepath() return this->changelogFilepath; } -std::string gameDetails::getApiJsonFilepath() +std::string gameDetails::getGameDetailsJsonFilepath() { - return this->apiJsonFilepath; + return this->gameDetailsJsonFilepath; } // Return vector containing all game files