Nothing concrete .
This commit is contained in:
parent
95600facf4
commit
a7ea749d2c
5 changed files with 18 additions and 13 deletions
|
|
@ -29,7 +29,7 @@ namespace isnd.Data.Catalog
|
|||
public RegistrationPage (string bid, string pkgid, string dlBase, IEnumerable<PackageVersion> items)
|
||||
{
|
||||
Bid = bid;
|
||||
Parent = Bid + "/index.json";
|
||||
Parent = Bid + $"/{pkgid}/index.json";
|
||||
DlBase = dlBase;
|
||||
this.items = new List<PackageVersion>(items);
|
||||
this.Id = Bid + "/" + pkgid + "/index.json";
|
||||
|
|
|
|||
|
|
@ -21,14 +21,20 @@ namespace isnd.Data.Catalog
|
|||
|
||||
public RegistrationPageIndex(string bid, string id, string dlBase, IEnumerable<Package> pkgs)
|
||||
{
|
||||
// leaves;
|
||||
this.Items = new List<RegistrationPage>
|
||||
(pkgs.GroupBy(l => l.Id)
|
||||
.Select(lg => new RegistrationPage
|
||||
(bid, lg.Key, dlBase, lg.ToArray()
|
||||
.Select(p => p.Versions).Aggregate
|
||||
((l, m) => { l.AddRange(m); return l.ToList(); })
|
||||
)));
|
||||
Items = new List<RegistrationPage>();
|
||||
var pkgsGroups = pkgs.GroupBy(l => l.Id);
|
||||
// Pour tous les groupes par Id
|
||||
foreach (var gsp in pkgsGroups)
|
||||
{
|
||||
var pkgsbi = gsp.ToArray();
|
||||
List<PackageVersion> versions = new List<PackageVersion>();
|
||||
|
||||
foreach(var l in pkgsbi.Select(p => p.Versions))
|
||||
{
|
||||
versions.AddRange(l);
|
||||
}
|
||||
Items.Add(new RegistrationPage(bid, gsp.Key, dlBase, versions));
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("count")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue