From 64d12503453686ec8dc294c45ecef627e1b28d3a Mon Sep 17 00:00:00 2001 From: Roger Far Date: Wed, 13 Jan 2021 11:46:57 -0700 Subject: [PATCH] Add radarr and sonarr categories to make the new version of radarr work. --- docker-publish.bat | 2 ++ .../Controllers/QBittorrentController.cs | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 docker-publish.bat diff --git a/docker-publish.bat b/docker-publish.bat new file mode 100644 index 0000000..7630860 --- /dev/null +++ b/docker-publish.bat @@ -0,0 +1,2 @@ +docker build --tag rogerfar/rdtclient . +docker push rogerfar/rdtclient \ No newline at end of file diff --git a/server/RdtClient.Web/Controllers/QBittorrentController.cs b/server/RdtClient.Web/Controllers/QBittorrentController.cs index 4f06f34..ef95213 100644 --- a/server/RdtClient.Web/Controllers/QBittorrentController.cs +++ b/server/RdtClient.Web/Controllers/QBittorrentController.cs @@ -307,6 +307,31 @@ namespace RdtClient.Web.Controllers public async Task>> TorrentsCategories() { var categories = await _qBittorrent.TorrentsCategories(); + + var savePath = await _qBittorrent.AppDefaultSavePath(); + + if (!categories.ContainsKey("radarr")) + { + var radarrPath = Path.Combine(savePath, "radarr"); + + categories.Add("radarr", new TorrentCategory + { + Name = "radarr", + SavePath = radarrPath + }); + } + + if (!categories.ContainsKey("sonarr")) + { + var sonarrPath = Path.Combine(savePath, "sonarr"); + + categories.Add("sonarr", new TorrentCategory + { + Name = "sonarr", + SavePath = sonarrPath + }); + } + return Ok(categories); }