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:
commit
2a38d43a1b
2 changed files with 5 additions and 4 deletions
|
|
@ -43,7 +43,7 @@ public class DbSettingsGeneral
|
||||||
public Int32 DownloadLimit { get; set; } = 2;
|
public Int32 DownloadLimit { get; set; } = 2;
|
||||||
|
|
||||||
[DisplayName("Maximum unpack processes")]
|
[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;
|
public Int32 UnpackLimit { get; set; } = 1;
|
||||||
|
|
||||||
[DisplayName("Categories")]
|
[DisplayName("Categories")]
|
||||||
|
|
|
||||||
|
|
@ -81,9 +81,9 @@ public class TorrentRunner(ILogger<TorrentRunner> logger, Torrents torrents, Dow
|
||||||
}
|
}
|
||||||
|
|
||||||
var settingUnpackLimit = Settings.Get.General.UnpackLimit;
|
var settingUnpackLimit = Settings.Get.General.UnpackLimit;
|
||||||
if (settingUnpackLimit < 1)
|
if (settingUnpackLimit < 0)
|
||||||
{
|
{
|
||||||
settingUnpackLimit = 1;
|
settingUnpackLimit = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
var settingDownloadPath = Settings.Get.DownloadClient.DownloadPath;
|
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);
|
var extension = Path.GetExtension(download.FileName);
|
||||||
|
|
||||||
if ((extension != ".rar" && extension != ".zip") ||
|
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);
|
Log($"No need to unpack, setting it as unpacked", download, torrent);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue