From 910419700021b7dfe0c7f9e0230df6f43a1ec488 Mon Sep 17 00:00:00 2001 From: Sam Heinz <54530346+asylumexp@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:53:54 +1000 Subject: [PATCH] Update TorBox.NET to v1.1.2 fixes GetInfoAsync rename to GetHashInfoAsync --- .../RdtClient.Service.csproj | 2 +- .../TorrentClients/TorBoxTorrentClient.cs | 20 +++++-------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/server/RdtClient.Service/RdtClient.Service.csproj b/server/RdtClient.Service/RdtClient.Service.csproj index 4fc239a..fdc2c13 100644 --- a/server/RdtClient.Service/RdtClient.Service.csproj +++ b/server/RdtClient.Service/RdtClient.Service.csproj @@ -22,7 +22,7 @@ - + diff --git a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs index 985a5be..c5ec039 100644 --- a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs @@ -24,8 +24,8 @@ public class TorBoxTorrentClient(ILogger logger, IHttpClien var httpClient = httpClientFactory.CreateClient(); httpClient.Timeout = TimeSpan.FromSeconds(Settings.Get.Provider.Timeout); - var rdtNetClient = new TorBoxNetClient(null, httpClient, 5); - rdtNetClient.UseApiAuthentication(apiKey); + var torBoxNetClient = new TorBoxNetClient(null, httpClient, 5); + torBoxNetClient.UseApiAuthentication(apiKey); // Get the server time to fix up the timezones on results if (_offset == null) @@ -34,7 +34,7 @@ public class TorBoxTorrentClient(ILogger logger, IHttpClien _offset = serverTime.Offset; } - return rdtNetClient; + return torBoxNetClient; } catch (AggregateException ae) { @@ -302,7 +302,7 @@ public class TorBoxTorrentClient(ILogger logger, IHttpClien var rdTorrent = await GetInfo(torrent.Hash); var files = new List(); - var torrentId = await GetClient().Torrents.GetInfoAsync(torrent.Hash, skipCache: true); + var torrentId = await GetClient().Torrents.GetHashInfoAsync(torrent.Hash, skipCache: true); if (Settings.Get.Provider.Zipped == true) { var newFile = $"https://torbox.app/fakedl/{torrentId?.Id}/zip"; @@ -332,18 +332,8 @@ public class TorBoxTorrentClient(ILogger logger, IHttpClien private async Task GetInfo(String torrentHash) { - var result = await GetClient().Torrents.GetInfoAsync(torrentHash, skipCache: true); + var result = await GetClient().Torrents.GetHashInfoAsync(torrentHash, skipCache: true); return Map(result!); } - - private void Log(String message, Data.Models.Data.Torrent? torrent = null) - { - if (torrent != null) - { - message = $"{message} {torrent.ToLog()}"; - } - - logger.LogDebug(message); - } } \ No newline at end of file