mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 11:49:17 +01:00
Galaxy: Fix downloading DLC files
Add product id from depot JSON to galaxyDepotItem struct Previously downloader failed to download DLC files because DLCs have different product id than base game Fix downloading DLC files by setting product id for each depot item
This commit is contained in:
parent
f5af312fd4
commit
8cbc62b8cd
@ -26,7 +26,6 @@ struct galaxyDepotItemChunk
|
||||
uintmax_t size_uncompressed;
|
||||
uintmax_t offset_compressed;
|
||||
uintmax_t offset_uncompressed;
|
||||
|
||||
};
|
||||
|
||||
struct galaxyDepotItem
|
||||
@ -36,6 +35,7 @@ struct galaxyDepotItem
|
||||
uintmax_t totalSizeCompressed;
|
||||
uintmax_t totalSizeUncompressed;
|
||||
std::string md5;
|
||||
std::string product_id;
|
||||
};
|
||||
|
||||
class galaxyAPI
|
||||
|
@ -3556,11 +3556,21 @@ void Downloader::galaxyInstallGame(const std::string& product_id, int build_inde
|
||||
continue;
|
||||
|
||||
std::string depotHash = json["depots"][i]["manifest"].asString();
|
||||
std::string depot_product_id = json["depots"][i]["productId"].asString();
|
||||
|
||||
if (depot_product_id.empty())
|
||||
depot_product_id = product_id;
|
||||
|
||||
std::vector<galaxyDepotItem> vec = gogGalaxy->getDepotItemsVector(depotHash);
|
||||
|
||||
// Set product id for items
|
||||
for (auto it = vec.begin(); it != vec.end(); ++it)
|
||||
it->product_id = depot_product_id;
|
||||
|
||||
items.insert(std::end(items), std::begin(vec), std::end(vec));
|
||||
}
|
||||
|
||||
off_t totalSize = 0;
|
||||
uintmax_t totalSize = 0;
|
||||
for (unsigned int i = 0; i < items.size(); ++i)
|
||||
{
|
||||
if (Globals::globalConfig.bVerbose)
|
||||
@ -3716,7 +3726,7 @@ void Downloader::galaxyInstallGame(const std::string& product_id, int build_inde
|
||||
chunk.memory = (char *) malloc(1);
|
||||
chunk.size = 0;
|
||||
|
||||
json = gogGalaxy->getSecureLink(product_id, gogGalaxy->hashToGalaxyPath(items[i].chunks[j].md5_compressed));
|
||||
json = gogGalaxy->getSecureLink(items[i].product_id, gogGalaxy->hashToGalaxyPath(items[i].chunks[j].md5_compressed));
|
||||
|
||||
// Prefer edgecast urls
|
||||
bool bPreferEdgecast = true;
|
||||
|
Loading…
Reference in New Issue
Block a user