From 5567b1a7cfedbbcca5f865590f385abe884ef2b4 Mon Sep 17 00:00:00 2001 From: js6pak Date: Tue, 18 Jul 2023 01:43:03 +0200 Subject: [PATCH] Download all pubfiles in a single call --- DepotDownloader/ContentDownloader.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index 1f8538eb..509dcfe4 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -354,6 +354,8 @@ namespace DepotDownloader { var list = steam3.GetPublishedFileDetails(appId, publishedFileIds); + var hcontentFiles = new HashSet(); + foreach (var details in list) { if (!string.IsNullOrEmpty(details?.file_url)) @@ -362,13 +364,18 @@ namespace DepotDownloader } else if (details?.hcontent_file > 0) { - await DownloadAppAsync(appId, new List<(uint, ulong)> { (appId, details.hcontent_file) }, DEFAULT_BRANCH, null, null, null, false, true); + hcontentFiles.Add(details.hcontent_file); } else { Console.WriteLine("Unable to locate manifest ID for published file {0}", details?.publishedfileid); } } + + if (hcontentFiles.Count > 0) + { + await DownloadAppAsync(appId, hcontentFiles.Select(f => (appId, f)).ToList(), DEFAULT_BRANCH, null, null, null, false, true); + } } public static async Task DownloadUGCAsync(uint appId, ulong ugcId)