From 75f115fd42c5aa59069ca04cf330c58bfb495cd4 Mon Sep 17 00:00:00 2001 From: Cucumberrbob <128094686+Cucumberrbob@users.noreply.github.com> Date: Sun, 13 Apr 2025 14:44:35 +0100 Subject: [PATCH] [TB] Make zipped downloads optional --- server/RdtClient.Data/Models/Internal/DbSettings.cs | 4 ++++ .../Services/TorrentClients/TorBoxTorrentClient.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/server/RdtClient.Data/Models/Internal/DbSettings.cs b/server/RdtClient.Data/Models/Internal/DbSettings.cs index 5ad2a57..767b989 100644 --- a/server/RdtClient.Data/Models/Internal/DbSettings.cs +++ b/server/RdtClient.Data/Models/Internal/DbSettings.cs @@ -197,6 +197,10 @@ or [Description("The interval to check the torrents info on the providers API. Minumum is 3 seconds. When there are no active downloads this limit is increased * 3.")] public Int32 CheckInterval { get; set; } = 10; + [DisplayName("Prefer zipped downloads")] + [Description("Torbox only. When selected, rdt-client will try to download the entire torrent as a .zip from TorBox and unpack it instead of downloading each file individually.")] + public Boolean PreferZippedDownloads { get; set; } = false; + [DisplayName("Auto Import Defaults")] public DbSettingsDefaultsWithCategory Default { get; set; } = new(); } diff --git a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs index 445f27e..a3113d2 100644 --- a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs @@ -290,7 +290,7 @@ public class TorBoxTorrentClient(ILogger logger, IHttpClien var torrentId = await GetClient().Torrents.GetHashInfoAsync(torrent.Hash, skipCache: true); var downloadableFiles = torrent.Files.Where(file => fileFilter.IsDownloadable(torrent, file.Path, file.Bytes)).ToList(); - if (downloadableFiles.Count == torrent.Files.Count && torrent.DownloadClient != Data.Enums.DownloadClient.Symlink) + if (downloadableFiles.Count == torrent.Files.Count && torrent.DownloadClient != Data.Enums.DownloadClient.Symlink && Settings.Get.Provider.PreferZippedDownloads) { logger.LogDebug("Downloading files from TorBox as a zip."); return [$"https://torbox.app/fakedl/{torrentId?.Id}/zip"];