mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 03:39:17 +01:00
Add option to list user data
This commit is contained in:
parent
eff194bcfe
commit
1866f4c65c
@ -123,6 +123,7 @@ namespace GlobalConstants
|
|||||||
const unsigned int LIST_FORMAT_DETAILS_JSON = 1 << 2;
|
const unsigned int LIST_FORMAT_DETAILS_JSON = 1 << 2;
|
||||||
const unsigned int LIST_FORMAT_TAGS = 1 << 3;
|
const unsigned int LIST_FORMAT_TAGS = 1 << 3;
|
||||||
const unsigned int LIST_FORMAT_TRANSFORMATIONS = 1 << 4;
|
const unsigned int LIST_FORMAT_TRANSFORMATIONS = 1 << 4;
|
||||||
|
const unsigned int LIST_FORMAT_USERDATA = 1 << 5;
|
||||||
|
|
||||||
const std::vector<optionsStruct> LIST_FORMAT =
|
const std::vector<optionsStruct> LIST_FORMAT =
|
||||||
{
|
{
|
||||||
@ -130,7 +131,8 @@ namespace GlobalConstants
|
|||||||
{ LIST_FORMAT_DETAILS_TEXT, "details", "Details", "d|details" },
|
{ LIST_FORMAT_DETAILS_TEXT, "details", "Details", "d|details" },
|
||||||
{ LIST_FORMAT_DETAILS_JSON, "json", "JSON", "j|json" },
|
{ LIST_FORMAT_DETAILS_JSON, "json", "JSON", "j|json" },
|
||||||
{ LIST_FORMAT_TAGS, "tags", "Tags", "t|tags" },
|
{ LIST_FORMAT_TAGS, "tags", "Tags", "t|tags" },
|
||||||
{ LIST_FORMAT_TRANSFORMATIONS, "transform", "Transformations", "tr|transform|transformations" }
|
{ LIST_FORMAT_TRANSFORMATIONS, "transform", "Transformations", "tr|transform|transformations" },
|
||||||
|
{ LIST_FORMAT_USERDATA, "userdata", "User data", "ud|userdata" }
|
||||||
};
|
};
|
||||||
|
|
||||||
const unsigned int GFTYPE_BASE_INSTALLER = 1 << 0;
|
const unsigned int GFTYPE_BASE_INSTALLER = 1 << 0;
|
||||||
|
@ -565,6 +565,21 @@ int Downloader::listGames()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (Globals::globalConfig.iListFormat == GlobalConstants::LIST_FORMAT_USERDATA)
|
||||||
|
{
|
||||||
|
Json::Value userdata;
|
||||||
|
std::istringstream response(gogWebsite->getResponse("https://embed.gog.com/userData.json"));
|
||||||
|
try
|
||||||
|
{
|
||||||
|
response >> userdata;
|
||||||
|
}
|
||||||
|
catch(const Json::Exception& exc)
|
||||||
|
{
|
||||||
|
std::cerr << "Failed to get user data" << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
std::cout << userdata << std::endl;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (this->games.empty()) {
|
if (this->games.empty()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user