From 8b16bd8ee26834b39c0d0568a932c924fab8e1c2 Mon Sep 17 00:00:00 2001 From: Sam Heinz <54530346+asylumexp@users.noreply.github.com> Date: Wed, 27 Nov 2024 05:01:55 +1000 Subject: [PATCH 1/2] [TB] Download files individually rather than via zip --- .../Services/TorrentClients/TorBoxTorrentClient.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs index b7a9407..94fe710 100644 --- a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs @@ -291,8 +291,11 @@ public class TorBoxTorrentClient(ILogger logger, IHttpClien var torrentId = await GetClient().Torrents.GetHashInfoAsync(torrent.Hash, skipCache: true); - var newFile = $"https://torbox.app/fakedl/{torrentId?.Id}/zip"; - files.Add(newFile); + foreach (var file in torrent.Files!) + { + var newFile = $"https://torbox.app/fakedl/{torrentId?.Id}/{file.Id}"; + files.Add(newFile); + } return files; } From 99c30bbc4fe21969295357bba765f82681d7258d Mon Sep 17 00:00:00 2001 From: Sam Heinz <54530346+asylumexp@users.noreply.github.com> Date: Wed, 27 Nov 2024 05:44:20 +1000 Subject: [PATCH 2/2] [TB] Fix source parameter null error --- .../Services/TorrentClients/TorBoxTorrentClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs index 94fe710..505ed22 100644 --- a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs @@ -73,7 +73,7 @@ public class TorBoxTorrentClient(ILogger logger, IHttpClien Progress = (Int64)((torrent.Progress) * 100.0), Status = torrent.DownloadState, Added = ChangeTimeZone(torrent.CreatedAt)!.Value, - Files = torrent.Files.Select(m => new TorrentClientFile + Files = (torrent.Files ?? []).Select(m => new TorrentClientFile { Path = String.Join("/", m.Name.Split('/').Skip(1)), Bytes = m.Size, @@ -291,7 +291,7 @@ public class TorBoxTorrentClient(ILogger logger, IHttpClien var torrentId = await GetClient().Torrents.GetHashInfoAsync(torrent.Hash, skipCache: true); - foreach (var file in torrent.Files!) + foreach (var file in torrent.Files) { var newFile = $"https://torbox.app/fakedl/{torrentId?.Id}/{file.Id}"; files.Add(newFile);