mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2025-02-01 21:42:31 +01:00
Galaxy: Add option to convert file path to lowercase for Windows game files
Some games for Windows have inconsistent casing for their file path. This option allows converting them to lowercase so we don't end up with multiple directories because capitalization makes them unique on case-sensitive filesystems.
This commit is contained in:
parent
70a4437c3c
commit
2beaf26bed
@ -57,6 +57,7 @@ struct DownloadConfig
|
|||||||
bool bDuplicateHandler;
|
bool bDuplicateHandler;
|
||||||
bool bGalaxyDependencies;
|
bool bGalaxyDependencies;
|
||||||
bool bDeleteOrphans;
|
bool bDeleteOrphans;
|
||||||
|
bool bGalaxyLowercasePath;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct gameSpecificConfig
|
struct gameSpecificConfig
|
||||||
|
1
main.cpp
1
main.cpp
@ -314,6 +314,7 @@ int main(int argc, char *argv[])
|
|||||||
("subdir-galaxy-install", bpo::value<std::string>(&Globals::globalConfig.dirConf.sGalaxyInstallSubdir)->default_value("%install_dir%"), galaxy_install_subdir_text.c_str())
|
("subdir-galaxy-install", bpo::value<std::string>(&Globals::globalConfig.dirConf.sGalaxyInstallSubdir)->default_value("%install_dir%"), galaxy_install_subdir_text.c_str())
|
||||||
("galaxy-cdn-priority", bpo::value<std::string>(&sGalaxyCDN)->default_value("edgecast,akamai_edgecast_proxy,fastly"), galaxy_cdn_priority_text.c_str())
|
("galaxy-cdn-priority", bpo::value<std::string>(&sGalaxyCDN)->default_value("edgecast,akamai_edgecast_proxy,fastly"), galaxy_cdn_priority_text.c_str())
|
||||||
("galaxy-list-cdns", bpo::value<std::string>(&galaxy_product_id_list_cdns)->default_value(""), "List available CDNs for game using product id [product_id/build_index] or gamename regex [gamename/build_id]\nBuild index is used to select a build and defaults to 0 if not specified.\n\nExample: 12345/2 selects build 2 for product 12345")
|
("galaxy-list-cdns", bpo::value<std::string>(&galaxy_product_id_list_cdns)->default_value(""), "List available CDNs for game using product id [product_id/build_index] or gamename regex [gamename/build_id]\nBuild index is used to select a build and defaults to 0 if not specified.\n\nExample: 12345/2 selects build 2 for product 12345")
|
||||||
|
("galaxy-lowercase-path", bpo::value<bool>(&Globals::globalConfig.dlConf.bGalaxyLowercasePath)->zero_tokens()->default_value(false), "Make filepath lowercase for Windows game files")
|
||||||
;
|
;
|
||||||
|
|
||||||
options_cli_all.add(options_cli_no_cfg).add(options_cli_cfg).add(options_cli_experimental);
|
options_cli_all.add(options_cli_no_cfg).add(options_cli_cfg).add(options_cli_experimental);
|
||||||
|
@ -581,6 +581,10 @@ Build (build index or build id) is used to select a build and defaults to 0 if n
|
|||||||
.br
|
.br
|
||||||
Example: 12345/2 selects build 2 for product 12345
|
Example: 12345/2 selects build 2 for product 12345
|
||||||
.br
|
.br
|
||||||
|
.TP
|
||||||
|
\fB\-\-galaxy\-lowercase\-path\fR arg
|
||||||
|
Make filepath lowercase for Windows game files
|
||||||
|
.br
|
||||||
.SH LANGUAGES
|
.SH LANGUAGES
|
||||||
Languages available to select with \fB\-\-language\fR and \fB\-\-galaxy\-language\fR options
|
Languages available to select with \fB\-\-language\fR and \fB\-\-galaxy\-language\fR options
|
||||||
.br
|
.br
|
||||||
|
@ -312,6 +312,12 @@ std::vector<galaxyDepotItem> galaxyAPI::getDepotItemsVector(const std::string& h
|
|||||||
item.sfc_size = json["depot"]["items"][i]["sfcRef"]["size"].asLargestUInt();
|
item.sfc_size = json["depot"]["items"][i]["sfcRef"]["size"].asLargestUInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Globals::globalConfig.dlConf.bGalaxyLowercasePath &&
|
||||||
|
Globals::globalConfig.dlConf.iGalaxyPlatform == GlobalConstants::PLATFORM_WINDOWS)
|
||||||
|
{
|
||||||
|
boost::algorithm::to_lower(item.path);
|
||||||
|
}
|
||||||
|
|
||||||
while (Util::replaceString(item.path, "\\", "/"));
|
while (Util::replaceString(item.path, "\\", "/"));
|
||||||
for (unsigned int j = 0; j < json["depot"]["items"][i]["chunks"].size(); ++j)
|
for (unsigned int j = 0; j < json["depot"]["items"][i]["chunks"].size(); ++j)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user