mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Disable the warning about no premium to streamline installs. Fix a update loop on the server
This commit is contained in:
parent
6c6768aab6
commit
9d3f36559e
@ -139,6 +139,9 @@ namespace Wabbajack.Lib.ModListRegistry
|
||||
public int Passed { get; set; }
|
||||
[JsonProperty("updating")]
|
||||
public int Updating { get; set; }
|
||||
|
||||
[JsonProperty("mirrored")]
|
||||
public int Mirrored { get; set; }
|
||||
|
||||
[JsonProperty("link")]
|
||||
public string Link => $"/lists/status/{MachineURL}.json";
|
||||
|
@ -102,6 +102,18 @@ namespace Wabbajack.BuildServer.Controllers
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
<h3>Mirrored ({{mirrored.Count}}):</h3>
|
||||
<ul>
|
||||
{{each $.mirrored }}
|
||||
{{if $.HasUrl}}
|
||||
<li><a href='{{$.Url}}'>{{$.Name}}</a></li>
|
||||
{{else}}
|
||||
<li>{{$.Name}}</li>
|
||||
{{/if}}
|
||||
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
<h3>Updating ({{updating.Count}}):</h3>
|
||||
<ul>
|
||||
{{each $.updating }}
|
||||
@ -141,6 +153,7 @@ namespace Wabbajack.BuildServer.Controllers
|
||||
passed = lst.Archives.Where(a => !a.IsFailing).ToList(),
|
||||
updated = lst.Archives.Where(a => a.ArchiveStatus == ArchiveStatus.Updated).ToList(),
|
||||
updating = lst.Archives.Where(a => a.ArchiveStatus == ArchiveStatus.Updating).ToList(),
|
||||
mirrored = lst.Archives.Where(a => a.ArchiveStatus == ArchiveStatus.Mirrored).ToList()
|
||||
});
|
||||
return new ContentResult
|
||||
{
|
||||
|
@ -6,5 +6,6 @@
|
||||
InValid,
|
||||
Updating,
|
||||
Updated,
|
||||
Mirrored
|
||||
}
|
||||
}
|
||||
|
@ -12,5 +12,6 @@ namespace Wabbajack.Server.DTOs
|
||||
public List<ModlistMetadata> ModLists { get; set; }
|
||||
|
||||
public ConcurrentHashSet<(Game Game, long ModId)> SlowQueriedFor { get; set; } = new ConcurrentHashSet<(Game Game, long ModId)>();
|
||||
public HashSet<Hash> Mirrors { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -17,11 +17,13 @@ namespace Wabbajack.Server.DataLayer
|
||||
var nexusFiles = AllNexusFiles();
|
||||
var archiveStatus = AllModListArchivesStatus();
|
||||
var modLists = AllModLists();
|
||||
var mirrors = GetAllMirroredHashes();
|
||||
return new ValidationData
|
||||
{
|
||||
NexusFiles = new ConcurrentHashSet<(long Game, long ModId, long FileId)>((await nexusFiles).Select(f => (f.NexusGameId, f.ModId, f.FileId))),
|
||||
ArchiveStatus = await archiveStatus,
|
||||
ModLists = await modLists,
|
||||
Mirrors = await mirrors,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -56,13 +56,19 @@ namespace Wabbajack.Server.Services
|
||||
{
|
||||
var (_, result) = await ValidateArchive(data, archive);
|
||||
if (result == ArchiveStatus.InValid)
|
||||
{
|
||||
if (data.Mirrors.Contains(archive.Hash))
|
||||
return (archive, ArchiveStatus.Mirrored);
|
||||
return await TryToHeal(data, archive, metadata);
|
||||
}
|
||||
|
||||
return (archive, result);
|
||||
});
|
||||
|
||||
var failedCount = archives.Count(f => f.Item2 == ArchiveStatus.InValid);
|
||||
var passCount = archives.Count(f => f.Item2 == ArchiveStatus.Valid || f.Item2 == ArchiveStatus.Updated);
|
||||
var updatingCount = archives.Count(f => f.Item2 == ArchiveStatus.Updating);
|
||||
var mirroredCount = archives.Count(f => f.Item2 == ArchiveStatus.Mirrored);
|
||||
|
||||
var summary = new ModListSummary
|
||||
{
|
||||
@ -70,6 +76,7 @@ namespace Wabbajack.Server.Services
|
||||
Failed = failedCount,
|
||||
Passed = passCount,
|
||||
Updating = updatingCount,
|
||||
Mirrored = mirroredCount,
|
||||
MachineURL = metadata.Links.MachineURL,
|
||||
Name = metadata.Title,
|
||||
};
|
||||
@ -84,7 +91,7 @@ namespace Wabbajack.Server.Services
|
||||
Archives = archives.Select(a => new DetailedStatusItem
|
||||
{
|
||||
Archive = a.Item1,
|
||||
IsFailing = a.Item2 == ArchiveStatus.InValid || a.Item2 == ArchiveStatus.Updating,
|
||||
IsFailing = a.Item2 == ArchiveStatus.InValid,
|
||||
ArchiveStatus = a.Item2
|
||||
}).ToList()
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user