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);