fix: Only add path separator in specific cases

This commit is contained in:
Sculas 2025-01-08 13:41:47 +01:00
parent 56934e3183
commit d6305c26f8
No known key found for this signature in database
GPG key ID: 1530BFF96D1EEB89

View file

@ -208,7 +208,13 @@ public class QBittorrent(ILogger<QBittorrent> 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;