From cc5da551f9ba67de5610e05eb5f155bb01e91324 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Fri, 2 Jun 2023 11:28:31 +0300 Subject: [PATCH] Case-insensitive comparison of `public` branch Fixes #429 Fixes #428 --- DepotDownloader/ContentDownloader.cs | 10 +++++----- DepotDownloader/Program.cs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index a4f8e854..1560bf4e 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -21,7 +21,7 @@ namespace DepotDownloader public const uint INVALID_APP_ID = uint.MaxValue; public const uint INVALID_DEPOT_ID = uint.MaxValue; public const ulong INVALID_MANIFEST_ID = ulong.MaxValue; - public const string DEFAULT_BRANCH = "Public"; + public const string DEFAULT_BRANCH = "public"; public static DownloadConfig Config = new DownloadConfig(); @@ -243,7 +243,7 @@ namespace DepotDownloader var node = manifests[branch].Children.Count > 0 ? manifests[branch]["gid"] : manifests[branch]; - if (branch != "Public" && node == KeyValue.Invalid) + if (node == KeyValue.Invalid && !string.Equals(branch, DEFAULT_BRANCH, StringComparison.OrdinalIgnoreCase)) { var node_encrypted = manifests_encrypted[branch]; if (node_encrypted != KeyValue.Invalid) @@ -589,10 +589,10 @@ namespace DepotDownloader if (manifestId == INVALID_MANIFEST_ID) { manifestId = GetSteam3DepotManifest(depotId, appId, branch); - if (manifestId == INVALID_MANIFEST_ID && branch != "public") + if (manifestId == INVALID_MANIFEST_ID && !string.Equals(branch, DEFAULT_BRANCH, StringComparison.OrdinalIgnoreCase)) { - Console.WriteLine("Warning: Depot {0} does not have branch named \"{1}\". Trying public branch.", depotId, branch); - branch = "public"; + Console.WriteLine("Warning: Depot {0} does not have branch named \"{1}\". Trying {2} branch.", depotId, branch, DEFAULT_BRANCH); + branch = DEFAULT_BRANCH; manifestId = GetSteam3DepotManifest(depotId, appId, branch); } diff --git a/DepotDownloader/Program.cs b/DepotDownloader/Program.cs index baae3e8e..eb396051 100644 --- a/DepotDownloader/Program.cs +++ b/DepotDownloader/Program.cs @@ -376,7 +376,7 @@ namespace DepotDownloader Console.WriteLine("\t-app <#>\t\t\t\t- the AppID to download."); Console.WriteLine("\t-depot <#>\t\t\t\t- the DepotID to download."); Console.WriteLine("\t-manifest \t\t\t- manifest id of content to download (requires -depot, default: current for branch)."); - Console.WriteLine("\t-beta \t\t\t- download from specified branch if available (default: Public)."); + Console.WriteLine($"\t-beta \t\t\t- download from specified branch if available (default: {ContentDownloader.DEFAULT_BRANCH})."); Console.WriteLine("\t-betapassword \t\t- branch password if applicable."); Console.WriteLine("\t-all-platforms\t\t\t- downloads all platform-specific depots when -app is used."); Console.WriteLine("\t-os \t\t\t\t- the operating system for which to download the game (windows, macos or linux, default: OS the program is currently running on)");