Skip to content

Commit

Permalink
sort campaigns by name
Browse files Browse the repository at this point in the history
  • Loading branch information
fgsfds committed Jun 9, 2024
1 parent 7562967 commit 4279791
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="xunit" Version="2.8.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.308.9" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.309.1" />
<PackageVersion Include="ConfigureAwaitAnalyzer" Version="1.0.3" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.6.2" />
<PackageVersion Include="Microsoft.AspNetCore.SpaProxy" Version="8.0.6" />
Expand Down
14 changes: 7 additions & 7 deletions src/Mods/Providers/InstalledAddonsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ public Dictionary<AddonVersion, IAddon> GetInstalledAddonsByType(AddonTypeEnum a
/// <inheritdoc/>
public Dictionary<AddonVersion, IAddon> GetInstalledCampaigns()
{
var originalCampaigns = _game.GetOriginalCampaigns();
var campaigns = _game.GetOriginalCampaigns();

if (_isCacheUpdating)
{
return originalCampaigns;
return campaigns;
}

_cache.ThrowIfNull();
Expand All @@ -170,20 +170,20 @@ public Dictionary<AddonVersion, IAddon> GetInstalledCampaigns()

if (result is not null)
{
foreach (var customCamp in result)
foreach (var customCamp in result.OrderBy(static x => x.Value.Title))
{
if (originalCampaigns.TryGetValue(customCamp.Key, out var _))
if (campaigns.TryGetValue(customCamp.Key, out var _))
{
//replacing original campaign with the downloaded one
originalCampaigns[customCamp.Key] = customCamp.Value;
campaigns[customCamp.Key] = customCamp.Value;
}
else
{
originalCampaigns.Add(customCamp.Key, customCamp.Value);
campaigns.Add(customCamp.Key, customCamp.Value);
}
}

return originalCampaigns;
return campaigns;
}
else
{
Expand Down

0 comments on commit 4279791

Please sign in to comment.