From 4d5c95b11950f69324dffc20735a3fdeab9720fd Mon Sep 17 00:00:00 2001 From: glax Date: Tue, 22 Jul 2025 18:04:49 +0200 Subject: [PATCH] Additional Query to get only downloading Manga --- API/Controllers/QueryController.cs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/API/Controllers/QueryController.cs b/API/Controllers/QueryController.cs index 70de774..e3062b0 100644 --- a/API/Controllers/QueryController.cs +++ b/API/Controllers/QueryController.cs @@ -1,6 +1,8 @@ -using API.Schema.MangaContext; +using API.MangaConnectors; +using API.Schema.MangaContext; using Asp.Versioning; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using static Microsoft.AspNetCore.Http.StatusCodes; // ReSharper disable InconsistentNaming @@ -62,13 +64,33 @@ public class QueryController(MangaContext context) : Controller return Ok(mcIdManga); } + /// + /// Returns all that are being downloaded from at least one + /// + /// + [HttpGet("Manga/Downloading")] + [ProducesResponseType(Status200OK, "application/json")] + public IActionResult GetMangaDownloading() + { + Manga[] ret = context.Mangas.Where(m => m.MangaConnectorIds.Any(id => id.UseForDownload)) + .Include(m => m.Library) + .Include(m => m.Authors) + .Include(m => m.MangaTags) + .Include(m => m.Links) + .Include(m => m.AltTitles) + .Include(m => m.Chapters) + .Include(m => m.MangaConnectorIds) + .ToArray(); + return Ok(ret); + } + /// /// Returns the with .Key /// /// Key of /// /// with not found - [HttpGet("chapter/MangaConnectorId/{MangaConnectorIdId}")] + [HttpGet("Chapter/MangaConnectorId/{MangaConnectorIdId}")] [ProducesResponseType>(Status200OK, "application/json")] [ProducesResponseType(Status404NotFound)] public IActionResult GetChapterMangaConnectorId(string MangaConnectorIdId)