From 00e499593ef2482be45bce967d4761486a26fb26 Mon Sep 17 00:00:00 2001 From: Sculas Date: Thu, 9 Jan 2025 16:23:56 +0100 Subject: [PATCH] fix: Fix Alldebrid path again --- server/RdtClient.Service/Services/QBittorrent.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/RdtClient.Service/Services/QBittorrent.cs b/server/RdtClient.Service/Services/QBittorrent.cs index 0260742..b53d7dc 100644 --- a/server/RdtClient.Service/Services/QBittorrent.cs +++ b/server/RdtClient.Service/Services/QBittorrent.cs @@ -208,12 +208,13 @@ public class QBittorrent(ILogger logger, Settings settings, Authent var torrentPath = downloadPath; if (!String.IsNullOrWhiteSpace(torrent.RdName)) { - torrentPath = Path.Combine(downloadPath, torrent.RdName); - // Alldebrid stores single file torrents at the root folder. - if (torrent.ClientKind != Torrent.TorrentClientKind.AllDebrid || torrent.Files.Count > 1) + if (torrent is { ClientKind: Torrent.TorrentClientKind.AllDebrid, Files.Count: 1 }) { - torrentPath += Path.DirectorySeparatorChar; + torrentPath = Path.Combine(downloadPath, torrent.Files[0].Path); + } else + { + torrentPath = Path.Combine(downloadPath, torrent.RdName) + Path.DirectorySeparatorChar; } }