From 5ad708e5b6f3bd61624668a09fc425e294738a01 Mon Sep 17 00:00:00 2001 From: Sude Date: Sat, 16 Mar 2013 23:21:01 +0200 Subject: [PATCH] Use the new "#name" variable in the API for installers --- src/api.cpp | 2 +- src/downloader.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api.cpp b/src/api.cpp index 6a0976f..9117241 100644 --- a/src/api.cpp +++ b/src/api.cpp @@ -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() ) diff --git a/src/downloader.cpp b/src/downloader.cpp index d1183da..98c54ae 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -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;