mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Allow to independently show real, image, or all media types.
This commit is contained in:
@@ -15,8 +15,18 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
|||||||
public MediasController(DicServerContext context) => _context = context;
|
public MediasController(DicServerContext context) => _context = context;
|
||||||
|
|
||||||
// GET: Admin/Medias
|
// GET: Admin/Medias
|
||||||
public IActionResult Index() => View(_context.Medias.ToList().OrderBy(m => m.PhysicalType).
|
public IActionResult Index(bool? real)
|
||||||
ThenBy(m => m.LogicalType).ThenBy(m => m.Real));
|
{
|
||||||
|
switch(real)
|
||||||
|
{
|
||||||
|
case null:
|
||||||
|
return View(_context.Medias.ToList().OrderBy(m => m.PhysicalType).ThenBy(m => m.LogicalType).
|
||||||
|
ThenBy(m => m.Real));
|
||||||
|
default:
|
||||||
|
return View(_context.Medias.Where(m => m.Real == real).ToList().OrderBy(m => m.PhysicalType).
|
||||||
|
ThenBy(m => m.LogicalType));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// GET: Admin/Medias/Delete/5
|
// GET: Admin/Medias/Delete/5
|
||||||
public async Task<IActionResult> Delete(int? id)
|
public async Task<IActionResult> Delete(int? id)
|
||||||
|
|||||||
Reference in New Issue
Block a user