Use the new "#name" variable in the API for installers

This commit is contained in:
Sude 2013-03-16 23:21:01 +02:00
parent 6aa24207c3
commit 5ad708e5b6
2 changed files with 4 additions and 1 deletions

View File

@ -323,7 +323,7 @@ gameDetails API::getGameDetails(const std::string& game_name, const unsigned int
game.installers.push_back(
gameFile( installer["#updated"].isBool() ? installer["#updated"].asBool() : false,
installer["id"].isInt() ? std::to_string(installer["id"].asInt()) : installer["id"].asString(),
std::string(), // empty string because installer doesn't have "name"
installer["#name"].asString(),
installer["link"].asString(),
installer["size"].asString()
)

View File

@ -276,6 +276,7 @@ void Downloader::listGames()
if (!config.bUpdateCheck || games[i].installers[j].updated) // Always list updated files
{
std::cout << "\tid: " << games[i].installers[j].id << std::endl
<< "\tname: " << games[i].installers[j].name << std::endl
<< "\tpath: " << games[i].installers[j].path << std::endl
<< "\tsize: " << games[i].installers[j].size << std::endl
<< "\tupdated: " << (games[i].installers[j].updated ? "True" : "False") << std::endl
@ -433,6 +434,8 @@ void Downloader::download()
// Download
if (!url.empty())
{
if (!games[i].installers[j].name.empty())
std::cout << "Dowloading: " << games[i].installers[j].name << std::endl;
std::cout << filepath << std::endl;
this->downloadFile(url, filepath);
std::cout << std::endl;