diff --git a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs index 556faa7..d68b249 100644 --- a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs @@ -288,9 +288,21 @@ public class TorBoxTorrentClient(ILogger logger, IHttpClien { var torrentId = await GetClient().Torrents.GetHashInfoAsync(torrent.Hash, skipCache: true); - return torrent.Files.Where(file => fileFilter.IsDownloadable(torrent, file.Path, file.Bytes)) - .Select(file => $"https://torbox.app/fakedl/{torrentId?.Id}/{file.Id}") - .ToList(); + bool allFilesDownloadable = torrent.Files.All(file => fileFilter.IsDownloadable(torrent, file.Path, file.Bytes)); + + if (allFilesDownloadable && torrent.DownloadClient != Data.Enums.DownloadClient.Symlink) + { + logger.LogDebug("Downloading files from TorBox as a zip."); + return [$"https://torbox.app/fakedl/{torrentId?.Id}/zip"]; + } + else + { + logger.LogDebug("Downloading files from TorBox individually."); + return torrent.Files + .Where(file => fileFilter.IsDownloadable(torrent, file.Path, file.Bytes)) + .Select(file => $"https://torbox.app/fakedl/{torrentId?.Id}/{file.Id}") + .ToList(); + } } public async Task GetFileName(String downloadUrl)