diff --git a/server/RdtClient.Service/Services/DownloadClient.cs b/server/RdtClient.Service/Services/DownloadClient.cs index 8c9d7b2..989c9c7 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,8 +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) { await FileHelper.Delete(filePath); diff --git a/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs index 911d8d4..546217c 100644 --- a/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs @@ -199,7 +199,7 @@ public class AllDebridTorrentClient(ILogger logger, IAll torrent.RdSize = torrentClientTorrent.Bytes; } - if (torrentClientTorrent.Files != null) + if (torrentClientTorrent.Files != null && torrentClientTorrent.Files.Any()) { torrent.RdFiles = JsonConvert.SerializeObject(torrentClientTorrent.Files); }