From d4294b6d129904e1ccaf2308ba700a75606d86bf Mon Sep 17 00:00:00 2001 From: Sude Date: Sun, 5 Mar 2017 22:05:08 +0200 Subject: [PATCH] Galaxy: Use install directory from json Use install directory value from json as subdirectory in directory specified by --directory If install directory was not set then use product id as subdirectory --- src/downloader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/downloader.cpp b/src/downloader.cpp index e817c1b..e624c89 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -3511,6 +3511,9 @@ void Downloader::galaxyInstallGame(const std::string& product_id, int build_inde json = gogGalaxy->getManifestV2(buildHash); std::string game_title = json["products"][0]["name"].asString(); + std::string install_directory = json["installDirectory"].asString(); + if (install_directory.empty()) + install_directory = product_id; std::vector items; for (unsigned int i = 0; i < json["depots"].size(); ++i) @@ -3550,7 +3553,7 @@ void Downloader::galaxyInstallGame(const std::string& product_id, int build_inde for (unsigned int i = 0; i < items.size(); ++i) { - boost::filesystem::path path = Globals::globalConfig.dirConf.sDirectory + items[i].path; + boost::filesystem::path path = Globals::globalConfig.dirConf.sDirectory + install_directory + "/" + items[i].path; // Check that directory exists and create it boost::filesystem::path directory = path.parent_path();