Skip files that are listed by API for information purposes only

For some games the API shows files with "count" and "total_size" of zero meaning that they are not available to download
These are listed on account page for information purpose only (for example to show DLCs included in the installer)
This commit is contained in:
Sude 2021-08-13 15:22:48 +03:00
parent 4e09d6357e
commit 209d83143e

View File

@ -330,6 +330,13 @@ std::vector<gameFile> galaxyAPI::fileJsonNodeToGameFileVector(const std::string&
continue;
}
// Skip file if count and total_size is zero
// https://github.com/Sude-/lgogdownloader/issues/200
unsigned int count = infoNode["count"].asUInt();
uintmax_t total_size = infoNode["total_size"].asLargestUInt();
if (count == 0 && total_size == 0)
continue;
for (unsigned int j = 0; j < iFiles; ++j)
{
Json::Value fileNode = infoNode["files"][j];