diff --git a/server/RdtClient.Web/Controllers/QBittorrentController.cs b/server/RdtClient.Web/Controllers/QBittorrentController.cs index 118b89e..2cb0c58 100644 --- a/server/RdtClient.Web/Controllers/QBittorrentController.cs +++ b/server/RdtClient.Web/Controllers/QBittorrentController.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using NSwag.Annotations; using RdtClient.Data.Enums; using RdtClient.Data.Models.QBittorrent; using RdtClient.Service.Services; @@ -12,6 +13,7 @@ namespace RdtClient.Web.Controllers; /// Documentation is found here: https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1) /// [ApiController] +[OpenApiIgnore] [Route("api/v2")] public class QBittorrentController(ILogger logger, QBittorrent qBittorrent) : Controller { diff --git a/server/RdtClient.Web/Controllers/TorrentsController.cs b/server/RdtClient.Web/Controllers/TorrentsController.cs index 69536b5..d6c6ec0 100644 --- a/server/RdtClient.Web/Controllers/TorrentsController.cs +++ b/server/RdtClient.Web/Controllers/TorrentsController.cs @@ -216,6 +216,7 @@ public class TorrentsController(ILogger logger, Torrents tor [HttpPost] [Route("VerifyRegex")] public async Task VerifyRegex([FromForm] IFormFile? file, [FromBody] TorrentControllerVerifyRegexRequest? request) + public async Task> VerifyRegex([FromBody] TorrentControllerVerifyRegexRequest? request) { if (request == null) { @@ -233,20 +234,6 @@ public class TorrentsController(ILogger logger, Torrents tor availableFiles = await torrents.GetAvailableFiles(magnet.InfoHashes.V1OrV2.ToHex()); } - else if (file != null) - { - var fileStream = file.OpenReadStream(); - - await using var memoryStream = new MemoryStream(); - - await fileStream.CopyToAsync(memoryStream); - - var bytes = memoryStream.ToArray(); - - var torrent = await MonoTorrent.Torrent.LoadAsync(bytes); - - availableFiles = await torrents.GetAvailableFiles(torrent.InfoHashes.V1OrV2.ToHex()); - } else { return BadRequest(); @@ -270,7 +257,7 @@ public class TorrentsController(ILogger logger, Torrents tor includeError = ex.Message; } } - } + } else if (!String.IsNullOrWhiteSpace(request.ExcludeRegex)) { foreach (var availableFile in availableFiles)