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; }
|
public int Passed { get; set; }
|
||||||
[JsonProperty("updating")]
|
[JsonProperty("updating")]
|
||||||
public int Updating { get; set; }
|
public int Updating { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("mirrored")]
|
||||||
|
public int Mirrored { get; set; }
|
||||||
|
|
||||||
[JsonProperty("link")]
|
[JsonProperty("link")]
|
||||||
public string Link => $"/lists/status/{MachineURL}.json";
|
public string Link => $"/lists/status/{MachineURL}.json";
|
||||||
|
@ -102,6 +102,18 @@ namespace Wabbajack.BuildServer.Controllers
|
|||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</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>
|
<h3>Updating ({{updating.Count}}):</h3>
|
||||||
<ul>
|
<ul>
|
||||||
{{each $.updating }}
|
{{each $.updating }}
|
||||||
@ -141,6 +153,7 @@ namespace Wabbajack.BuildServer.Controllers
|
|||||||
passed = lst.Archives.Where(a => !a.IsFailing).ToList(),
|
passed = lst.Archives.Where(a => !a.IsFailing).ToList(),
|
||||||
updated = lst.Archives.Where(a => a.ArchiveStatus == ArchiveStatus.Updated).ToList(),
|
updated = lst.Archives.Where(a => a.ArchiveStatus == ArchiveStatus.Updated).ToList(),
|
||||||
updating = lst.Archives.Where(a => a.ArchiveStatus == ArchiveStatus.Updating).ToList(),
|
updating = lst.Archives.Where(a => a.ArchiveStatus == ArchiveStatus.Updating).ToList(),
|
||||||
|
mirrored = lst.Archives.Where(a => a.ArchiveStatus == ArchiveStatus.Mirrored).ToList()
|
||||||
});
|
});
|
||||||
return new ContentResult
|
return new ContentResult
|
||||||
{
|
{
|
||||||
|
@ -6,5 +6,6 @@
|
|||||||
InValid,
|
InValid,
|
||||||
Updating,
|
Updating,
|
||||||
Updated,
|
Updated,
|
||||||
|
Mirrored
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,5 +12,6 @@ namespace Wabbajack.Server.DTOs
|
|||||||
public List<ModlistMetadata> ModLists { get; set; }
|
public List<ModlistMetadata> ModLists { get; set; }
|
||||||
|
|
||||||
public ConcurrentHashSet<(Game Game, long ModId)> SlowQueriedFor { get; set; } = new ConcurrentHashSet<(Game Game, long ModId)>();
|
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 nexusFiles = AllNexusFiles();
|
||||||
var archiveStatus = AllModListArchivesStatus();
|
var archiveStatus = AllModListArchivesStatus();
|
||||||
var modLists = AllModLists();
|
var modLists = AllModLists();
|
||||||
|
var mirrors = GetAllMirroredHashes();
|
||||||
return new ValidationData
|
return new ValidationData
|
||||||
{
|
{
|
||||||
NexusFiles = new ConcurrentHashSet<(long Game, long ModId, long FileId)>((await nexusFiles).Select(f => (f.NexusGameId, f.ModId, f.FileId))),
|
NexusFiles = new ConcurrentHashSet<(long Game, long ModId, long FileId)>((await nexusFiles).Select(f => (f.NexusGameId, f.ModId, f.FileId))),
|
||||||
ArchiveStatus = await archiveStatus,
|
ArchiveStatus = await archiveStatus,
|
||||||
ModLists = await modLists,
|
ModLists = await modLists,
|
||||||
|
Mirrors = await mirrors,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,13 +56,19 @@ namespace Wabbajack.Server.Services
|
|||||||
{
|
{
|
||||||
var (_, result) = await ValidateArchive(data, archive);
|
var (_, result) = await ValidateArchive(data, archive);
|
||||||
if (result == ArchiveStatus.InValid)
|
if (result == ArchiveStatus.InValid)
|
||||||
|
{
|
||||||
|
if (data.Mirrors.Contains(archive.Hash))
|
||||||
|
return (archive, ArchiveStatus.Mirrored);
|
||||||
return await TryToHeal(data, archive, metadata);
|
return await TryToHeal(data, archive, metadata);
|
||||||
|
}
|
||||||
|
|
||||||
return (archive, result);
|
return (archive, result);
|
||||||
});
|
});
|
||||||
|
|
||||||
var failedCount = archives.Count(f => f.Item2 == ArchiveStatus.InValid);
|
var failedCount = archives.Count(f => f.Item2 == ArchiveStatus.InValid);
|
||||||
var passCount = archives.Count(f => f.Item2 == ArchiveStatus.Valid || f.Item2 == ArchiveStatus.Updated);
|
var passCount = archives.Count(f => f.Item2 == ArchiveStatus.Valid || f.Item2 == ArchiveStatus.Updated);
|
||||||
var updatingCount = archives.Count(f => f.Item2 == ArchiveStatus.Updating);
|
var updatingCount = archives.Count(f => f.Item2 == ArchiveStatus.Updating);
|
||||||
|
var mirroredCount = archives.Count(f => f.Item2 == ArchiveStatus.Mirrored);
|
||||||
|
|
||||||
var summary = new ModListSummary
|
var summary = new ModListSummary
|
||||||
{
|
{
|
||||||
@ -70,6 +76,7 @@ namespace Wabbajack.Server.Services
|
|||||||
Failed = failedCount,
|
Failed = failedCount,
|
||||||
Passed = passCount,
|
Passed = passCount,
|
||||||
Updating = updatingCount,
|
Updating = updatingCount,
|
||||||
|
Mirrored = mirroredCount,
|
||||||
MachineURL = metadata.Links.MachineURL,
|
MachineURL = metadata.Links.MachineURL,
|
||||||
Name = metadata.Title,
|
Name = metadata.Title,
|
||||||
};
|
};
|
||||||
@ -84,7 +91,7 @@ namespace Wabbajack.Server.Services
|
|||||||
Archives = archives.Select(a => new DetailedStatusItem
|
Archives = archives.Select(a => new DetailedStatusItem
|
||||||
{
|
{
|
||||||
Archive = a.Item1,
|
Archive = a.Item1,
|
||||||
IsFailing = a.Item2 == ArchiveStatus.InValid || a.Item2 == ArchiveStatus.Updating,
|
IsFailing = a.Item2 == ArchiveStatus.InValid,
|
||||||
ArchiveStatus = a.Item2
|
ArchiveStatus = a.Item2
|
||||||
}).ToList()
|
}).ToList()
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user