From 7eb1a610b4676b4f54f68f23e20ec27f2c890ea6 Mon Sep 17 00:00:00 2001 From: Cucumberrbob <128094686+Cucumberrbob@users.noreply.github.com> Date: Fri, 21 Mar 2025 13:35:51 +0000 Subject: [PATCH] use ternary not `(Boolean) switch` --- server/RdtClient.Service/Services/Torrents.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/RdtClient.Service/Services/Torrents.cs b/server/RdtClient.Service/Services/Torrents.cs index 505e1af..0c92c29 100644 --- a/server/RdtClient.Service/Services/Torrents.cs +++ b/server/RdtClient.Service/Services/Torrents.cs @@ -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);