Skip to content

Commit

Permalink
Fix cloud file listing.
Browse files Browse the repository at this point in the history
Check --ids for collections, and then process them.
Change --collection legacy argument to only accept a list of workshop ids (ulong).
Upgrade Tests project nuget packages, fixes test explorer being broken when switching between debug and release.
  • Loading branch information
Gwindalmir committed Sep 4, 2021
1 parent d3a05c4 commit c8a40e3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="nunit" Version="3.10.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="nunit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 9 additions & 2 deletions WorkshopToolCommon/GameBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,15 @@ static System.Threading.Tasks.Task<bool> DownloadMods(ProcessedOptions options)
var items = new List<MyWorkshopItem>();
// get collection information
options.Collections.ForEach(s => items.AddRange(WorkshopHelper.GetCollectionDetails(ulong.Parse(s))));
items.AddRange(WorkshopHelper.GetItemDetails(options.Ids));
options.Collections.ForEach(i => items.AddRange(WorkshopHelper.GetCollectionDetails(i)));
WorkshopHelper.GetItemDetails(options.Ids).ForEach(item =>
{
// Ids can contain any workshop id, including collections, so check each one
if (item.ItemType == MyWorkshopItemType.Collection)
items.AddRange(WorkshopHelper.GetCollectionDetails(item.Id));
else
items.Add(item);
});
options.Mods = CombineCollectionWithList(WorkshopType.Mod, items, options.Mods);
options.Blueprints = CombineCollectionWithList(WorkshopType.Blueprint, items, options.Blueprints);
Expand Down
2 changes: 1 addition & 1 deletion WorkshopToolCommon/Options/LegacyOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public sealed class LegacyOptions : Options.OptionBase
public IEnumerable<string> Tags { get; set; }

[Option("collections", HelpText = "List of Workshop IDs of collections to download")]
public IEnumerable<string> Collections { get; set; }
public IEnumerable<ulong> Collections { get; set; }

[Option("thumb", HelpText = "Thumbnail to upload (doesn't re-upload mod)")]
public string Thumbnail { get; set; }
Expand Down
13 changes: 8 additions & 5 deletions WorkshopToolCommon/Options/ProcessedOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public class ProcessedOptions
public bool Download => Type == typeof(DownloadVerb);
public bool Extract { get; set; }
public IList<ulong> Ids { get; set; }
public IList<ulong> Collections { get; set; }

// Upload properties
public bool Upload => Type == typeof(UploadVerb);
public bool UpdateOnly { get; set; }
public bool DryRun { get; set; }
public bool Compile { get; set; }
public IList<string> Collections { get; set; }
public IList<string> Mods { get; set; }
public IList<string> Blueprints { get; set; }
public IList<string> Scenarios { get; set; }
Expand Down Expand Up @@ -197,10 +197,13 @@ public ProcessedOptions(LegacyOptions options)
Dependencies = options.Dependencies?.ToList();
Collections = options.Collections?.ToList();
ListDLCs = options.ListDLCs;
if (options.ClearSteamCloud && Force)
Clear = options.ClearSteamCloud;
else
ListCloud = true;
if (options.ClearSteamCloud)
{
if (Force || options.DeleteSteamCloudFiles?.Count() > 0)
Clear = options.ClearSteamCloud;
else
ListCloud = true;
}
Files = options.DeleteSteamCloudFiles?.ToList();
}

Expand Down

0 comments on commit c8a40e3

Please sign in to comment.