mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 11:49:17 +01:00
Make --list show number of updates for games that have been updated
Allows user to check for updated games more easily
This commit is contained in:
parent
6d6a676e0a
commit
b9bb37b36a
@ -49,6 +49,7 @@ struct gameItem
|
||||
std::string id;
|
||||
std::vector<std::string> dlcnames;
|
||||
Json::Value gamedetailsjson;
|
||||
int updates = 0;
|
||||
};
|
||||
|
||||
struct wishlistItem
|
||||
|
@ -597,7 +597,14 @@ int Downloader::listGames()
|
||||
|
||||
for (unsigned int i = 0; i < gameItems.size(); ++i)
|
||||
{
|
||||
std::cout << gameItems[i].name << std::endl;
|
||||
std::string gamename = gameItems[i].name;
|
||||
if (gameItems[i].updates > 0)
|
||||
{
|
||||
gamename += " [" + std::to_string(gameItems[i].updates) + "]";
|
||||
if (config.bColor)
|
||||
gamename = "\033[32m" + gamename + "\033[0m";
|
||||
}
|
||||
std::cout << gamename << std::endl;
|
||||
for (unsigned int j = 0; j < gameItems[i].dlcnames.size(); ++j)
|
||||
std::cout << "+> " << gameItems[i].dlcnames[j] << std::endl;
|
||||
}
|
||||
|
@ -163,6 +163,7 @@ std::vector<gameItem> Website::getGames()
|
||||
gameItem game;
|
||||
game.name = product["slug"].asString();
|
||||
game.id = product["id"].isInt() ? std::to_string(product["id"].asInt()) : product["id"].asString();
|
||||
game.updates = product["updates"].isInt() ? product["updates"].asInt() : std::stoi(product["updates"].asString());
|
||||
|
||||
unsigned int platform = 0;
|
||||
if (product["worksOn"]["Windows"].asBool())
|
||||
|
Loading…
Reference in New Issue
Block a user