From ab5a013edb6abb79649ee3de30f1d7133f1ceab3 Mon Sep 17 00:00:00 2001 From: Cucumberrbob <128094686+Cucumberrbob@users.noreply.github.com> Date: Mon, 17 Mar 2025 20:23:05 +0000 Subject: [PATCH] [TB] use `torrentClientTorrent` (if it's passed) instead of fetching in `UpdateData` Makes `ProviderUpdater` only cause 2 API requests each run rather than `O(n)` where `n` is the number of torrents --- .../Services/TorrentClients/TorBoxTorrentClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs index 5cfcd3f..95d8718 100644 --- a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs @@ -206,7 +206,7 @@ public class TorBoxTorrentClient(ILogger logger, IHttpClien return torrent; } - var rdTorrent = await GetInfo(torrent.Hash) ?? throw new($"Resource not found"); + var rdTorrent = torrentClientTorrent ?? await GetInfo(torrent.Hash) ?? throw new($"Resource not found"); if (!String.IsNullOrWhiteSpace(rdTorrent.Filename)) {