diff --git a/server/RdtClient.Service/Services/Torrents.cs b/server/RdtClient.Service/Services/Torrents.cs index d6894b8..569d336 100644 --- a/server/RdtClient.Service/Services/Torrents.cs +++ b/server/RdtClient.Service/Services/Torrents.cs @@ -28,7 +28,7 @@ public class Torrents private readonly PremiumizeTorrentClient _premiumizeTorrentClient; private readonly RealDebridTorrentClient _realDebridTorrentClient; - private ITorrentClient _torrentClient + private ITorrentClient TorrentClient { get { @@ -125,7 +125,7 @@ public class Torrents throw new Exception($"{ex.Message}, trying to parse {magnetLink}"); } - var id = await _torrentClient.AddMagnet(magnetLink); + var id = await TorrentClient.AddMagnet(magnetLink); var hash = magnet.InfoHash.ToHex(); @@ -151,7 +151,7 @@ public class Torrents throw new Exception($"{ex.Message}, trying to parse {fileAsBase64}"); } - var id = await _torrentClient.AddFile(bytes); + var id = await TorrentClient.AddFile(bytes); var hash = monoTorrent.InfoHash.ToHex(); @@ -164,7 +164,7 @@ public class Torrents public async Task> GetAvailableFiles(String hash) { - var result = await _torrentClient.GetAvailableFiles(hash); + var result = await TorrentClient.GetAvailableFiles(hash); return result; } @@ -178,7 +178,7 @@ public class Torrents return; } - await _torrentClient.SelectFiles(torrent); + await TorrentClient.SelectFiles(torrent); } public async Task CreateDownloads(Guid torrentId) @@ -190,7 +190,7 @@ public class Torrents return; } - var downloadLinks = await _torrentClient.GetDownloadLinks(torrent); + var downloadLinks = await TorrentClient.GetDownloadLinks(torrent); if (downloadLinks == null) { @@ -275,7 +275,7 @@ public class Torrents try { - await _torrentClient.Delete(torrent.RdId); + await TorrentClient.Delete(torrent.RdId); } catch { @@ -329,7 +329,7 @@ public class Torrents Log($"Unrestricting link", download, download.Torrent); - var unrestrictedLink = await _torrentClient.Unrestrict(download.Path); + var unrestrictedLink = await TorrentClient.Unrestrict(download.Path); await _downloads.UpdateUnrestrictedLink(downloadId, unrestrictedLink); @@ -338,7 +338,7 @@ public class Torrents public async Task GetProfile() { - var user = await _torrentClient.GetUser(); + var user = await TorrentClient.GetUser(); var profile = new Profile { @@ -360,7 +360,7 @@ public class Torrents try { - var rdTorrents = await _torrentClient.GetTorrents(); + var rdTorrents = await TorrentClient.GetTorrents(); foreach (var rdTorrent in rdTorrents) { @@ -739,7 +739,7 @@ public class Torrents ReferenceHandler = ReferenceHandler.IgnoreCycles }); - await _torrentClient.UpdateData(torrent, torrentClientTorrent); + await TorrentClient.UpdateData(torrent, torrentClientTorrent); var newTorrent = JsonSerializer.Serialize(torrent, new JsonSerializerOptions