diff --git a/Source/Website/Controllers/ReleaseController.cs b/Source/Website/Controllers/ReleaseController.cs index dfbbe3d..73d600b 100644 --- a/Source/Website/Controllers/ReleaseController.cs +++ b/Source/Website/Controllers/ReleaseController.cs @@ -79,7 +79,11 @@ public async Task ReleaseDetailPage(string? slugId, bool? preview // page data ViewData[PageInfo.SidebarList] = await _context.QueryNewsModels(5); - ViewData["_ReleaseScreenshots"] = await GitHub.GetFilesAsync("releases/screenshots/v9.0-beta-4"); + if (!string.IsNullOrEmpty(model.ScreenshotsDir)) + { + ViewData["_ReleaseScreenshots"] = await GitHub.GetFilesAsync("releases/screenshots", model.ScreenshotsDir); + } + return View("ReleaseDetailPage", model); } diff --git a/Source/Website/Views/Release/ReleaseDetailPage.cshtml b/Source/Website/Views/Release/ReleaseDetailPage.cshtml index 3b9021f..45e556a 100644 --- a/Source/Website/Views/Release/ReleaseDetailPage.cshtml +++ b/Source/Website/Views/Release/ReleaseDetailPage.cshtml @@ -3,7 +3,7 @@ @{ var list = (PaginatedList?)ViewData[PageInfo.SidebarList]; - var screenshots = (List)ViewData["_ReleaseScreenshots"] ?? new(); + var screenshots = ((List?)ViewData["_ReleaseScreenshots"]) ?? new(); }