Merge pull request #817 from Cucumberrbob/feat/turn-off-auto-unpack

Don't unpack if `UnpackLimit` is set to `0`
This commit is contained in:
Roger Far 2025-05-18 11:11:49 -06:00 committed by GitHub
commit 2a38d43a1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 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,9 +81,9 @@ public class TorrentRunner(ILogger<TorrentRunner> logger, Torrents torrents, Dow
}
var settingUnpackLimit = Settings.Get.General.UnpackLimit;
if (settingUnpackLimit < 1)
if (settingUnpackLimit < 0)
{
settingUnpackLimit = 1;
settingUnpackLimit = 0;
}
var settingDownloadPath = Settings.Get.DownloadClient.DownloadPath;
@ -485,7 +485,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);