From ae36ca74636e25fd30d6424b0cfb8b83cf9b38e8 Mon Sep 17 00:00:00 2001 From: trawzified <55751269+tr4wzified@users.noreply.github.com> Date: Sat, 26 Oct 2024 14:06:11 +0200 Subject: [PATCH] Fix not generating images for lists that have been forced down --- Wabbajack.CLI/Verbs/ValidateLists.cs | 44 +++++++++++++--------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/Wabbajack.CLI/Verbs/ValidateLists.cs b/Wabbajack.CLI/Verbs/ValidateLists.cs index 0d1aff817..a406ada62 100644 --- a/Wabbajack.CLI/Verbs/ValidateLists.cs +++ b/Wabbajack.CLI/Verbs/ValidateLists.cs @@ -126,13 +126,6 @@ public async Task 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); @@ -153,9 +146,29 @@ public async Task 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 => @@ -209,21 +222,6 @@ public async Task 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();