From 209d83143eaea03697ad842ed6c4a2c2ede580bb Mon Sep 17 00:00:00 2001 From: Sude Date: Fri, 13 Aug 2021 15:22:48 +0300 Subject: [PATCH] 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) --- src/galaxyapi.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/galaxyapi.cpp b/src/galaxyapi.cpp index dce8c1f..f976c4a 100644 --- a/src/galaxyapi.cpp +++ b/src/galaxyapi.cpp @@ -330,6 +330,13 @@ std::vector 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];