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)