fix: Fix Alldebrid path again

This commit is contained in:
Sculas 2025-01-09 16:23:56 +01:00
parent d6305c26f8
commit 00e499593e
No known key found for this signature in database
GPG key ID: 1530BFF96D1EEB89

View file

@ -208,12 +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);
// 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;
}
}