registration and detail url's
This commit is contained in:
@ -12,6 +12,7 @@ using NuGet.Protocol;
|
||||
using NuGet.Packaging;
|
||||
using NuGet.Packaging.Core;
|
||||
using System.Threading.Tasks;
|
||||
using isnd.Entities;
|
||||
|
||||
namespace isnd.Data.Catalog
|
||||
{
|
||||
@ -24,7 +25,7 @@ namespace isnd.Data.Catalog
|
||||
/// <param name="apiBase">api Base</param>
|
||||
/// <param name="uri">package permalink</param>
|
||||
/// <returns></returns>
|
||||
public PackageDetails(PackageVersion pkg, string apiBase, string uri): base(uri)
|
||||
public PackageDetails(PackageVersion pkg, string apiBase): base( apiBase + ApiConfig.Registration + "/" + pkg.PackageId + "/" + pkg.FullString + ".json")
|
||||
{
|
||||
PackageId = pkg.Package.Id;
|
||||
Version = pkg.FullString;
|
||||
@ -40,8 +41,9 @@ namespace isnd.Data.Catalog
|
||||
dependencyGroups = pkg.DependencyGroups.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Licence Project Urls, Summary, Title, etc ...
|
||||
PackageDetailsUrl = new Uri(this.id);
|
||||
|
||||
// TODO Licence Project Urls, Summary, Title, Owners, etc ...
|
||||
}
|
||||
|
||||
[JsonProperty("@type")]
|
||||
|
@ -76,8 +76,7 @@ namespace isnd.Data
|
||||
|
||||
public Catalog.Package ToPackage(string apiBase)
|
||||
{
|
||||
return new Catalog.Package(apiBase, this.PackageId , FullString,
|
||||
new Catalog.PackageDetails(this, apiBase, apiBase + ApiConfig.Registration + "/" + this.PackageId + "/" + FullString + ".json"));
|
||||
return new Catalog.Package(apiBase, this.PackageId , FullString, new Catalog.PackageDetails(this, apiBase));
|
||||
}
|
||||
|
||||
public bool IsDeleted => LatestCommit?.Action == PackageAction.DeletePackage;
|
||||
|
@ -37,7 +37,9 @@ namespace isnd.ViewModels
|
||||
version = package.GetLatestVersion(),
|
||||
description = package.Description,
|
||||
title = package.Id,
|
||||
versions = package.Versions.Select(v => new SearchVersionInfo(regId, v)).ToArray()
|
||||
versions = package.Versions.Select(v => new SearchVersionInfo(regId, v)).ToArray(),
|
||||
registration = regId,
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user