mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fix preflight checks
This commit is contained in:
parent
26eb1ed38b
commit
79fc1b345d
@ -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",
|
||||
|
@ -88,22 +88,10 @@ namespace Wabbajack.Lib.AuthorApi
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IReadOnlyList<(string MachineURL, Version Version)>> GetMyModlists()
|
||||
public async Task<IReadOnlyList<string>> GetMyModlists()
|
||||
{
|
||||
var myLists = await _client.GetJsonAsync<string[]>($"{Consts.WabbajackBuildServerUri}author_controls/lists");
|
||||
List<(string MachineURL, Version Version)> lists = new();
|
||||
var client = await GitHub.Client.Get();
|
||||
foreach (var file in Enum.GetValues<GitHub.Client.List>())
|
||||
{
|
||||
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<Uri> UploadFile(WorkQueue queue, AbsolutePath path, Action<string, Percent> progressFn)
|
||||
|
Loading…
Reference in New Issue
Block a user