Skip to content

Commit

Permalink
Merge pull request #2637 from wabbajack-tools/rename-validated-images
Browse files Browse the repository at this point in the history
Fix not generating images for lists that have been forced down
  • Loading branch information
tr4wzified authored Oct 26, 2024
2 parents e32c57c + ece548a commit 6842458
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions Wabbajack.CLI/Verbs/ValidateLists.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,6 @@ public async Task<int> Run(AbsolutePath reports, AbsolutePath otherArchives)
Version = modList.Version
};

if (modList.ForceDown)
{
_logger.LogWarning("List is ForceDown, skipping");
validatedList.Status = ListStatus.ForcedDown;
return validatedList;
}

using var scope = _logger.BeginScope("MachineURL: {MachineUrl}", modList.NamespacedName);
_logger.LogInformation("Verifying {MachineUrl} - {Title}", modList.NamespacedName, modList.Title);
//await DownloadModList(modList, archiveManager, CancellationToken.None);
Expand All @@ -153,9 +146,29 @@ public async Task<int> Run(AbsolutePath reports, AbsolutePath otherArchives)
validatedList.Status = ListStatus.ForcedDown;
return validatedList;
}


try
{
var (smallImage, largeImage) = await ProcessModlistImage(reports, modList, token);
validatedList.SmallImage =
new Uri(
$"https://raw.githubusercontent.com/wabbajack-tools/mod-lists/master/reports/{smallImage.ToString().Replace("\\", "/")}");
validatedList.LargeImage =
new Uri(
$"https://raw.githubusercontent.com/wabbajack-tools/mod-lists/master/reports/{largeImage.ToString().Replace("\\", "/")}");
}
catch (Exception ex)
{
_logger.LogError(ex, "While processing modlist images for {MachineURL}", modList.NamespacedName);
}

if (modList.ForceDown)
{
_logger.LogWarning("List is ForceDown, skipping archive verificiation");
validatedList.Status = ListStatus.ForcedDown;
return validatedList;
}

_logger.LogInformation("Verifying {Count} archives from {Name}", modListData.Archives.Length, modList.NamespacedName);

var archives = await modListData.Archives.PMapAll(async archive =>
Expand Down Expand Up @@ -209,21 +222,6 @@ public async Task<int> Run(AbsolutePath reports, AbsolutePath otherArchives)
? ListStatus.Failed
: ListStatus.Available;

try
{
var (smallImage, largeImage) = await ProcessModlistImage(reports, modList, token);
validatedList.SmallImage =
new Uri(
$"https://raw.githubusercontent.com/wabbajack-tools/mod-lists/master/reports/{smallImage.ToString().Replace("\\", "/")}");
validatedList.LargeImage =
new Uri(
$"https://raw.githubusercontent.com/wabbajack-tools/mod-lists/master/reports/{largeImage.ToString().Replace("\\", "/")}");
}
catch (Exception ex)
{
_logger.LogError(ex, "While processing modlist images for {MachineURL}", modList.NamespacedName);
}

return validatedList;
}).ToArray();

Expand Down

0 comments on commit 6842458

Please sign in to comment.