Skip to content

Commit 279b883

Browse files
committed
Merge branch 'update-expanded-dlcs-list' of https://github.com/szekelyszilv/lgogdownloader
2 parents f555f11 + dc18ce1 commit 279b883

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/galaxyapi.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,18 @@ std::vector<galaxyDepotItem> galaxyAPI::getDepotItemsVector(const std::string& h
353353

354354
Json::Value galaxyAPI::getProductInfo(const std::string& product_id)
355355
{
356-
std::string url = "https://api.gog.com/products/" + product_id + "?expand=downloads,expanded_dlcs,description,screenshots,videos,related_products,changelog&locale=en-US";
356+
const std::string main_url = "https://api.gog.com/products/" + product_id + "?expand=downloads,description,screenshots,videos,related_products,changelog&locale=en-US";
357357

358-
return this->getResponseJson(url);
358+
Json::Value product_info = this->getResponseJson(main_url);
359+
360+
if (product_info["dlcs"].isObject())
361+
{
362+
const std::string dlc_url = product_info["dlcs"]["expanded_all_products_url"].asString();
363+
364+
product_info["expanded_dlcs"] = this->getResponseJson(dlc_url);
365+
}
366+
367+
return product_info;
359368
}
360369

361370
gameDetails galaxyAPI::productInfoJsonToGameDetails(const Json::Value& json, const DownloadConfig& dlConf)

0 commit comments

Comments
 (0)