make setting UnpackLimit to 0 turn unpacking off

This commit is contained in:
Cucumberrbob 2025-05-17 13:30:22 +01:00
parent ea3839514d
commit e17c8c5c1a
No known key found for this signature in database
GPG key ID: 2B935C47401C3614
2 changed files with 3 additions and 6 deletions

View file

@ -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")]

View file

@ -81,10 +81,6 @@ public class TorrentRunner(ILogger<TorrentRunner> 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<TorrentRunner> 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);