changed name

This commit is contained in:
nerdspice 2023-12-28 09:54:05 -05:00
parent d7c10ae6fe
commit 5ce801fa0d
6 changed files with 18 additions and 18 deletions

View File

@ -46,7 +46,7 @@ struct DownloadConfig
bool bRemoteXML;
bool bSaveChangelogs;
bool bSaveSerials;
bool bSaveApiJson;
bool bSaveGameDetailsJson;
bool bSaveLogo;
bool bSaveIcon;
bool bAutomaticXMLCreation;

View File

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

View File

@ -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<gameFile> getGameFileVector();
std::vector<gameFile> 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

View File

@ -261,7 +261,7 @@ int main(int argc, char *argv[])
("use-cache", bpo::value<bool>(&Globals::globalConfig.bUseCache)->zero_tokens()->default_value(false), ("Use game details cache"))
("cache-valid", bpo::value<int>(&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<bool>(&Globals::globalConfig.dlConf.bSaveSerials)->zero_tokens()->default_value(false), "Save serial numbers when downloading")
("save-api-json", bpo::value<bool>(&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<bool>(&Globals::globalConfig.dlConf.bSaveGameDetailsJson)->zero_tokens()->default_value(false), "Save game details JSON data AS-IS to \"game-details.json\"")
("save-logo", bpo::value<bool>(&Globals::globalConfig.dlConf.bSaveLogo)->zero_tokens()->default_value(false), "Save logo when downloading")
("save-icon", bpo::value<bool>(&Globals::globalConfig.dlConf.bSaveIcon)->zero_tokens()->default_value(false), "Save icon when downloading")
("ignore-dlc-count", bpo::value<std::string>(&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")

View File

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

View File

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