From 439b266946860a937be66b403127ab5cfd2edf70 Mon Sep 17 00:00:00 2001 From: Cucumberrbob <128094686+Cucumberrbob@users.noreply.github.com> Date: Thu, 20 Feb 2025 14:57:44 +0000 Subject: [PATCH 1/3] Actually use `GetSymlinkPath` --- server/RdtClient.Service/Services/DownloadClient.cs | 3 ++- .../Services/TorrentClients/AllDebridTorrentClient.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/RdtClient.Service/Services/DownloadClient.cs b/server/RdtClient.Service/Services/DownloadClient.cs index 8c9d7b2..ef74a05 100644 --- a/server/RdtClient.Service/Services/DownloadClient.cs +++ b/server/RdtClient.Service/Services/DownloadClient.cs @@ -33,6 +33,8 @@ public class DownloadClient(Download download, Torrent torrent, String destinati try { + Type = torrent.DownloadClient; + if (download.Link == null) { throw new($"Invalid download link"); @@ -56,7 +58,6 @@ public class DownloadClient(Download download, Torrent torrent, String destinati throw new("Invalid download path"); } - Type = torrent.DownloadClient; if (Type != Data.Enums.DownloadClient.Symlink) { diff --git a/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs index ed8249a..41d29fc 100644 --- a/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs @@ -191,7 +191,7 @@ public class AllDebridTorrentClient(ILogger logger, IHtt torrent.RdSize = torrentClientTorrent.Bytes; } - if (torrentClientTorrent.Files != null) + if (torrentClientTorrent.Files != null && torrentClientTorrent.Files.Any()) { torrent.RdFiles = JsonConvert.SerializeObject(torrentClientTorrent.Files); } @@ -248,6 +248,7 @@ public class AllDebridTorrentClient(ILogger logger, IHtt var allFiles = await GetClient().Magnet.FilesAsync(Int64.Parse(torrent.RdId)); var files = GetFiles(allFiles); + // torrent.RdFiles = JsonConvert.SerializeObject(files); Log($"Getting download links", torrent); From 8e1f61472a7830b3ca2fad370217aca72c9d67fa Mon Sep 17 00:00:00 2001 From: Cucumberrbob <128094686+Cucumberrbob@users.noreply.github.com> Date: Thu, 20 Feb 2025 14:58:37 +0000 Subject: [PATCH 2/3] remove commented out line --- .../Services/TorrentClients/AllDebridTorrentClient.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs index 41d29fc..a15a3e6 100644 --- a/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs @@ -248,7 +248,6 @@ public class AllDebridTorrentClient(ILogger logger, IHtt var allFiles = await GetClient().Magnet.FilesAsync(Int64.Parse(torrent.RdId)); var files = GetFiles(allFiles); - // torrent.RdFiles = JsonConvert.SerializeObject(files); Log($"Getting download links", torrent); From d292fbaee83358c6dce49b7d3f0b74d9809845d0 Mon Sep 17 00:00:00 2001 From: Cucumberrbob <128094686+Cucumberrbob@users.noreply.github.com> Date: Thu, 20 Feb 2025 14:59:09 +0000 Subject: [PATCH 3/3] remove superfluous newline --- server/RdtClient.Service/Services/DownloadClient.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/server/RdtClient.Service/Services/DownloadClient.cs b/server/RdtClient.Service/Services/DownloadClient.cs index ef74a05..989c9c7 100644 --- a/server/RdtClient.Service/Services/DownloadClient.cs +++ b/server/RdtClient.Service/Services/DownloadClient.cs @@ -58,7 +58,6 @@ public class DownloadClient(Download download, Torrent torrent, String destinati throw new("Invalid download path"); } - if (Type != Data.Enums.DownloadClient.Symlink) { await FileHelper.Delete(filePath);