use ternary not (Boolean) switch

This commit is contained in:
Cucumberrbob 2025-03-21 13:35:51 +00:00
parent 74e6d2cf95
commit 7eb1a610b4
No known key found for this signature in database
GPG key ID: 2B935C47401C3614

View file

@ -232,11 +232,9 @@ public class Torrents(
logger.LogDebug("Adding {hash} to debrid provider {torrentInfo}", torrent.Hash, torrent.ToLog());
var id = (torrent.IsFile) switch
{
true => await TorrentClient.AddFile(Convert.FromBase64String(torrent.FileOrMagnet)),
false => await TorrentClient.AddMagnet(torrent.FileOrMagnet)
};
var id = torrent.IsFile
? await TorrentClient.AddFile(Convert.FromBase64String(torrent.FileOrMagnet))
: await TorrentClient.AddMagnet(torrent.FileOrMagnet);
await torrentData.UpdateRdId(torrent, id);