Skip if appid in list fails.

pull/583/head
Alstruit 10 months ago
parent 140a10fe77
commit 8b8d6d79de
No known key found for this signature in database
GPG Key ID: 4F57E6793C946CEC

@ -271,63 +271,49 @@ namespace DepotDownloader
try try
{ {
foreach (var appId in appIdList) foreach (var appId in appIdList)
{ {
var depotManifestIds = new List<(uint, ulong)>(); var depotManifestIds = new List<(uint, ulong)>();
var isUGC = false; var isUGC = false;
if (manifestIdList.Count > 0) if (manifestIdList.Count > 0)
{ {
if (depotIdList.Count != manifestIdList.Count) if (depotIdList.Count != manifestIdList.Count)
{ {
Console.WriteLine("Error: -manifest requires one id for every -depot specified"); Console.WriteLine("Error: -manifest requires one id for every -depot specified");
return 1; return 1;
} }
var zippedDepotManifest = depotIdList.Zip(manifestIdList, (depotId, manifestId) => (depotId, manifestId)); var zippedDepotManifest = depotIdList.Zip(manifestIdList, (depotId, manifestId) => (depotId, manifestId));
depotManifestIds.AddRange(zippedDepotManifest); depotManifestIds.AddRange(zippedDepotManifest);
} }
else else
{ {
depotManifestIds.AddRange(depotIdList.Select(depotId => (depotId, ContentDownloader.INVALID_MANIFEST_ID))); depotManifestIds.AddRange(depotIdList.Select(depotId => (depotId, ContentDownloader.INVALID_MANIFEST_ID)));
} }
try
{
await ContentDownloader.DownloadAppAsync(appId, depotManifestIds, branch, os, arch, language, lv, isUGC).ConfigureAwait(false); await ContentDownloader.DownloadAppAsync(appId, depotManifestIds, branch, os, arch, language, lv, isUGC).ConfigureAwait(false);
}
catch (ContentDownloaderException ex)
{
Console.WriteLine($"Warning: {ex.Message}");
// Continue with the next appId
}
catch (OperationCanceledException ex)
{
Console.WriteLine($"Warning: Operation canceled for AppID {appId}: {ex.Message}");
// Decide whether to continue or break. Here, we continue.
}
} }
} }
catch (Exception ex) when ( catch (Exception ex) // Handle other unforeseen exceptions
ex is ContentDownloaderException
|| ex is OperationCanceledException)
{ {
Console.WriteLine(ex.Message); Console.WriteLine("An unexpected error occurred: " + ex.Message);
return 1; return 1;
} }
catch (Exception e)
{
Console.WriteLine("Download failed to due to an unhandled exception: {0}", e.Message);
throw;
}
finally finally
{ {
ContentDownloader.ShutdownSteam3(); ContentDownloader.ShutdownSteam3();

Loading…
Cancel
Save