use ternary not (Boolean) switch
This commit is contained in:
parent
74e6d2cf95
commit
7eb1a610b4
1 changed files with 3 additions and 5 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue