|
|
|
@ -211,9 +211,14 @@ namespace isnd.Services
|
|
|
|
|
(string pkgId, string semver = null, string pkgType = null)
|
|
|
|
|
{
|
|
|
|
|
return (await dbContext.PackageVersions
|
|
|
|
|
.Include(v => v.Package).Include(v => v.Package.Owner)
|
|
|
|
|
.Include(v => v.Package)
|
|
|
|
|
.Include(v => v.Package.LatestCommit)
|
|
|
|
|
.Include(v => v.Package.Owner)
|
|
|
|
|
.Include(v => v.LatestCommit)
|
|
|
|
|
.Where(v => v.PackageId == pkgId
|
|
|
|
|
&& v.FullString == semver).SingleOrDefaultAsync()).ToPackage(
|
|
|
|
|
&& v.FullString == semver
|
|
|
|
|
&& v.LatestCommit !=null
|
|
|
|
|
).SingleOrDefaultAsync()).ToPackage(
|
|
|
|
|
apiBase);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -237,6 +242,7 @@ namespace isnd.Services
|
|
|
|
|
return dbContext.PackageVersions
|
|
|
|
|
.Include(v => v.Package)
|
|
|
|
|
.Include(v => v.Package.Owner)
|
|
|
|
|
.Include(v => v.Package.LatestCommit)
|
|
|
|
|
.Include(v => v.LatestCommit)
|
|
|
|
|
.Where(v => v.PackageId == pkgId && semver == v.FullString
|
|
|
|
|
&& (pkgType == null || pkgType == v.Type)
|
|
|
|
@ -264,6 +270,7 @@ namespace isnd.Services
|
|
|
|
|
.Include(p => p.Versions)
|
|
|
|
|
.Include(p => p.Owner)
|
|
|
|
|
.Include(p => p.LatestCommit)
|
|
|
|
|
.Include(p => p.Versions[0].LatestCommit)
|
|
|
|
|
.SingleOrDefaultAsync(p => p.Id.ToLower() == query.Query);
|
|
|
|
|
if (scope==null) return null;
|
|
|
|
|
if (scope.Versions.Count==0) return null;
|
|
|
|
@ -283,8 +290,11 @@ namespace isnd.Services
|
|
|
|
|
.Include(p => p.Owner)
|
|
|
|
|
.Include(p => p.Versions)
|
|
|
|
|
.Include(p => p.LatestCommit)
|
|
|
|
|
.Include(p => p.LatestCommit.Versions)
|
|
|
|
|
.Where(p => p.Id.StartsWith(query.Query)
|
|
|
|
|
&& (query.Prerelease || p.Versions.Any(p => !p.IsPrerelease)))
|
|
|
|
|
&& p.LatestCommit != null
|
|
|
|
|
&& (query.Prerelease || p.Versions.Any(p => !p.IsPrerelease))
|
|
|
|
|
&& p.Versions.Count()>0)
|
|
|
|
|
.OrderBy(p => p.CommitNId);
|
|
|
|
|
|
|
|
|
|
return new PackageSearchResult(await scope.Skip(query.Skip).Take(query.Take)
|
|
|
|
|