lgogdownloader/src/gamefile.cpp
Sude 706158d595 Get game details using Galaxy API
Game details are now acquired using Galaxy API.
Allow using most features without valid downloader API login by changing Downloader::isLoggedIn to return false only if website is not logged in.
--download-file still uses old API and will not work without valid API login. Downloader::downloadFileWithId prints error message and exits if user doesn't have valid API login.
Game details cache version is incremented because of changes to gameFile class.
Show product id for DLCs when using --list-details option.
Rewrote Downloader::repair to remove duplicated code.
Fixed serials containing <br> tags.
2017-09-13 16:46:46 +03:00

50 lines
1.2 KiB
C++

/* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://www.wtfpl.net/ for more details. */
#include "gamefile.h"
gameFile::gameFile()
{
this->platform = GlobalConstants::PLATFORM_WINDOWS;
this->language = GlobalConstants::LANGUAGE_EN;
this->silent = 0;
this->type = 0;
}
gameFile::~gameFile()
{
//dtor
}
void gameFile::setFilepath(const std::string& path)
{
this->filepath = path;
}
std::string gameFile::getFilepath()
{
return this->filepath;
}
Json::Value gameFile::getAsJson()
{
Json::Value json;
json["updated"] = this->updated;
json["id"] = this->id;
json["name"] = this->name;
json["path"] = this->path;
json["size"] = this->size;
json["platform"] = this->platform;
json["language"] = this->language;
json["silent"] = this->silent;
json["gamename"] = this->gamename;
json["type"] = this->type;
json["galaxy_downlink_json_url"] = this->galaxy_downlink_json_url;
return json;
}