From e17c8c5c1aa2979bd00948a0564e8a84443daee7 Mon Sep 17 00:00:00 2001 From: Cucumberrbob <128094686+Cucumberrbob@users.noreply.github.com> Date: Sat, 17 May 2025 13:30:22 +0100 Subject: [PATCH 1/2] make setting `UnpackLimit` to `0` turn unpacking off --- server/RdtClient.Data/Models/Internal/DbSettings.cs | 2 +- server/RdtClient.Service/Services/TorrentRunner.cs | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/server/RdtClient.Data/Models/Internal/DbSettings.cs b/server/RdtClient.Data/Models/Internal/DbSettings.cs index 14c8606..8a67e9d 100644 --- a/server/RdtClient.Data/Models/Internal/DbSettings.cs +++ b/server/RdtClient.Data/Models/Internal/DbSettings.cs @@ -43,7 +43,7 @@ public class DbSettingsGeneral public Int32 DownloadLimit { get; set; } = 2; [DisplayName("Maximum unpack processes")] - [Description("Maximum amount of downloads that get unpacked on your host at the same time.")] + [Description("Maximum amount of downloads that get unpacked on your host at the same time. Set to 0 to disable unpacking.")] public Int32 UnpackLimit { get; set; } = 1; [DisplayName("Categories")] diff --git a/server/RdtClient.Service/Services/TorrentRunner.cs b/server/RdtClient.Service/Services/TorrentRunner.cs index b137275..30f1f10 100644 --- a/server/RdtClient.Service/Services/TorrentRunner.cs +++ b/server/RdtClient.Service/Services/TorrentRunner.cs @@ -81,10 +81,6 @@ public class TorrentRunner(ILogger logger, Torrents torrents, Dow } var settingUnpackLimit = Settings.Get.General.UnpackLimit; - if (settingUnpackLimit < 1) - { - settingUnpackLimit = 1; - } var settingDownloadPath = Settings.Get.DownloadClient.DownloadPath; if (String.IsNullOrWhiteSpace(settingDownloadPath)) @@ -485,7 +481,8 @@ public class TorrentRunner(ILogger logger, Torrents torrents, Dow var extension = Path.GetExtension(download.FileName); if ((extension != ".rar" && extension != ".zip") || - torrent.DownloadClient == Data.Enums.DownloadClient.Symlink) + torrent.DownloadClient == Data.Enums.DownloadClient.Symlink || + settingUnpackLimit == 0) { Log($"No need to unpack, setting it as unpacked", download, torrent); From 6ec3b1072be34dca8251395d87530c6234f1892a Mon Sep 17 00:00:00 2001 From: Roger Far <1142915+rogerfar@users.noreply.github.com> Date: Sun, 18 May 2025 11:11:17 -0600 Subject: [PATCH 2/2] Update server/RdtClient.Service/Services/TorrentRunner.cs Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com> --- server/RdtClient.Service/Services/TorrentRunner.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/RdtClient.Service/Services/TorrentRunner.cs b/server/RdtClient.Service/Services/TorrentRunner.cs index 30f1f10..e7ba302 100644 --- a/server/RdtClient.Service/Services/TorrentRunner.cs +++ b/server/RdtClient.Service/Services/TorrentRunner.cs @@ -81,6 +81,10 @@ public class TorrentRunner(ILogger logger, Torrents torrents, Dow } var settingUnpackLimit = Settings.Get.General.UnpackLimit; + if (settingUnpackLimit < 0) + { + settingUnpackLimit = 0; + } var settingDownloadPath = Settings.Get.DownloadClient.DownloadPath; if (String.IsNullOrWhiteSpace(settingDownloadPath))