public ActionResult PackageExists(string packageId) { return(new JsonResult(new { success = new { exists = _indexService.GetManifest(packageId) != null } })); }
public IActionResult Package(string packageId, int page) { ViewData["packageId"] = packageId; Manifest manifest = _indexService.GetManifest(packageId); if (manifest == null) { return(View("Error404")); } ViewData["manifest"] = manifest; if (page != 0) { page--; } Pager pager = new Pager(); PageableData <ManifestItem> filesPage = new PageableData <ManifestItem>(manifest.Files.Skip(page * _settings.ListPageSize).Take(_settings.ListPageSize), page, _settings.ListPageSize, manifest.Files.Count); ViewData["filesPage"] = filesPage; ViewData["filesPager"] = pager.Render(filesPage, _settings.PagesPerPageGroup, $"/package/{packageId}", "page", "#manifestFiles"); return(View()); }