From 79fc1b345d78194748a3ed81b23585dae644180e Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Sat, 2 Apr 2022 10:45:09 -0600 Subject: [PATCH] Fix preflight checks --- Wabbajack.Lib/ACompiler.cs | 2 +- Wabbajack.Lib/AuthorApi/Client.cs | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/Wabbajack.Lib/ACompiler.cs b/Wabbajack.Lib/ACompiler.cs index 87e6501e..c34e179f 100644 --- a/Wabbajack.Lib/ACompiler.cs +++ b/Wabbajack.Lib/ACompiler.cs @@ -183,7 +183,7 @@ namespace Wabbajack.Lib if (PublishData == null) return; var ourLists = await (await AuthorApi.Client.Create()).GetMyModlists(); - if (ourLists.All(l => l.MachineURL != PublishData.MachineUrl)) + if (ourLists.All(l => l != PublishData.MachineUrl)) { Utils.ErrorThrow(new CriticalFailureIntervention( $"Cannot publish to {PublishData.MachineUrl}, you are not listed as a maintainer", diff --git a/Wabbajack.Lib/AuthorApi/Client.cs b/Wabbajack.Lib/AuthorApi/Client.cs index ed081c38..6f5d3367 100644 --- a/Wabbajack.Lib/AuthorApi/Client.cs +++ b/Wabbajack.Lib/AuthorApi/Client.cs @@ -88,22 +88,10 @@ namespace Wabbajack.Lib.AuthorApi }); } - public async Task> GetMyModlists() + public async Task> GetMyModlists() { var myLists = await _client.GetJsonAsync($"{Consts.WabbajackBuildServerUri}author_controls/lists"); - List<(string MachineURL, Version Version)> lists = new(); - var client = await GitHub.Client.Get(); - foreach (var file in Enum.GetValues()) - { - foreach (var lst in (await client.GetData(file)).Lists) - { - if (myLists.Contains(lst.Links.MachineURL)) - { - lists.Add((lst.Links.MachineURL, lst.Version ?? new Version())); - } - } - } - return lists; + return myLists; } public async Task UploadFile(WorkQueue queue, AbsolutePath path, Action progressFn)