Update versions when uploading new modlists

This commit is contained in:
Timothy Baldridge 2021-07-19 16:22:04 -06:00
parent 04347bbd06
commit 81c93c6e18
3 changed files with 9 additions and 1 deletions

View File

@ -62,6 +62,7 @@ namespace Wabbajack.Lib.GitHub
if (found == null) continue;
found.DownloadMetadata = newData;
found.Version = newData.Version;
await WriteData(file, machineUrl, data.Hash, data.Lists);
return;

View File

@ -139,6 +139,7 @@ namespace Wabbajack.Lib.ModListRegistry
public Hash Hash { get; set; }
public long Size { get; set; }
public Version Version { get; set; } = new();
public long NumberOfArchives { get; set; }
public long SizeOfArchives { get; set; }
public long NumberOfInstalledFiles { get; set; }

View File

@ -22,7 +22,9 @@ namespace Wabbajack.Test
Hash = Hash.FromLong(rnd.Next()),
NumberOfArchives = rnd.Next(100),
NumberOfInstalledFiles = rnd.Next(1000),
SizeOfInstalledFiles = rnd.Next(1000000)
SizeOfInstalledFiles = rnd.Next(1000000),
Size = rnd.Next(10000),
Version = new Version(1, 0, rnd.Next(10), 0)
};
await client.UpdateList("ci_tester", "ci_test", meta);
@ -30,6 +32,10 @@ namespace Wabbajack.Test
var lst = updated.Lists.FirstOrDefault(l => l.Links.MachineURL == "ci_test");
var newMeta = lst!.DownloadMetadata!;
Assert.Equal(meta.Hash, newMeta.Hash);
Assert.Equal(meta.Size, newMeta.Size);
Assert.Equal(meta.Version, newMeta.Version);
Assert.Equal(lst.Version, newMeta.Version);
Assert.Equal(meta.NumberOfArchives, newMeta.NumberOfArchives);
Assert.Equal(meta.NumberOfInstalledFiles, newMeta.NumberOfInstalledFiles);
Assert.Equal(meta.SizeOfInstalledFiles, newMeta.SizeOfInstalledFiles);