From d6305c26f864f0a1ac5af754ae6be95d1c2be808 Mon Sep 17 00:00:00 2001 From: Sculas Date: Wed, 8 Jan 2025 13:41:47 +0100 Subject: [PATCH] fix: Only add path separator in specific cases --- server/RdtClient.Service/Services/QBittorrent.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/RdtClient.Service/Services/QBittorrent.cs b/server/RdtClient.Service/Services/QBittorrent.cs index e20f7c1..0260742 100644 --- a/server/RdtClient.Service/Services/QBittorrent.cs +++ b/server/RdtClient.Service/Services/QBittorrent.cs @@ -208,7 +208,13 @@ public class QBittorrent(ILogger logger, Settings settings, Authent var torrentPath = downloadPath; if (!String.IsNullOrWhiteSpace(torrent.RdName)) { - torrentPath = Path.Combine(downloadPath, torrent.RdName) + Path.DirectorySeparatorChar; + 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) + { + torrentPath += Path.DirectorySeparatorChar; + } } Int64 bytesDone = 0;