net6.0
This commit is contained in:
parent
70f6e411e5
commit
4f040be236
18 changed files with 144 additions and 99 deletions
|
|
@ -47,7 +47,7 @@ namespace isnd.Data.Catalog
|
|||
NuGetVersion upper = new NuGetVersion(0,0,0);
|
||||
|
||||
// Assert.True(items.All(p=>p.Id == id));
|
||||
|
||||
long commitMax = 0;
|
||||
foreach (var p in items)
|
||||
{
|
||||
if (upper < p.NugetVersion) upper = p.NugetVersion;
|
||||
|
|
@ -57,8 +57,11 @@ namespace isnd.Data.Catalog
|
|||
foreach (var p in items)
|
||||
{
|
||||
if (lower > p.NugetVersion) lower = p.NugetVersion;
|
||||
if (p.CommitNId>commitMax) commitMax = p.CommitNId;
|
||||
}
|
||||
Lower = lower.ToFullString();
|
||||
Count = items.Count;
|
||||
CommitId = commitMax.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ namespace isnd.Data.Catalog
|
|||
/// </summary>
|
||||
/// <value></value>
|
||||
[JsonProperty("@id")]
|
||||
[JsonRequired]
|
||||
public string Id { get; protected set; }
|
||||
|
||||
public RegistrationPageIndex()
|
||||
|
|
@ -21,7 +22,9 @@ namespace isnd.Data.Catalog
|
|||
|
||||
public RegistrationPageIndex(string bid, string id, string dlBase, IEnumerable<Package> pkgs)
|
||||
{
|
||||
|
||||
Items = new List<RegistrationPage>();
|
||||
long cnid = 0;
|
||||
var pkgsGroups = pkgs.GroupBy(l => l.Id);
|
||||
// Pour tous les groupes par Id
|
||||
foreach (var gsp in pkgsGroups)
|
||||
|
|
@ -32,13 +35,23 @@ namespace isnd.Data.Catalog
|
|||
foreach(var l in pkgsbi.Select(p => p.Versions))
|
||||
{
|
||||
versions.AddRange(l);
|
||||
foreach (var pv in l)
|
||||
{
|
||||
if (pv.CommitNId> cnid)
|
||||
{
|
||||
cnid = pv.CommitNId;
|
||||
}
|
||||
}
|
||||
}
|
||||
Items.Add(new RegistrationPage(bid, gsp.Key, dlBase, versions));
|
||||
}
|
||||
CommitId = cnid.ToString();
|
||||
Id = bid + $"/{id}/index.json";
|
||||
Count = Items.Count;
|
||||
}
|
||||
|
||||
[JsonProperty("count")]
|
||||
public int Count { get => Items?.Count ?? 0; }
|
||||
public int Count { get ; private set; }
|
||||
|
||||
[JsonProperty("items")]
|
||||
public List<RegistrationPage> Items { get; set; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue