From 818d9f06b289fa682d936e4add3407eefbd211af Mon Sep 17 00:00:00 2001 From: Cucumberrbob <128094686+Cucumberrbob@users.noreply.github.com> Date: Fri, 7 Mar 2025 22:26:18 +0000 Subject: [PATCH 1/2] include version when setting torbox api client useragent --- .../Services/TorrentClients/TorBoxTorrentClient.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs index 556faa7..23f6f73 100644 --- a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs @@ -1,3 +1,4 @@ +using System.Reflection; using Microsoft.Extensions.Logging; using Newtonsoft.Json; using TorBoxNET; @@ -24,7 +25,7 @@ public class TorBoxTorrentClient(ILogger logger, IHttpClien } var httpClient = httpClientFactory.CreateClient(); - httpClient.DefaultRequestHeaders.Add("User-Agent", "rdt-client"); + httpClient.DefaultRequestHeaders.Add("User-Agent", $"rdt-client {Assembly.GetExecutingAssembly().GetName().Version}"); httpClient.Timeout = TimeSpan.FromSeconds(Settings.Get.Provider.Timeout); var torBoxNetClient = new TorBoxNetClient(null, httpClient, 5); From f8587d1bc8da6e4224f1f5c81a5637c4c4f13281 Mon Sep 17 00:00:00 2001 From: Cucumberrbob <128094686+Cucumberrbob@users.noreply.github.com> Date: Fri, 7 Mar 2025 22:40:02 +0000 Subject: [PATCH 2/2] fixup! include version when setting torbox api client useragent --- .../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 23f6f73..ced192b 100644 --- a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs @@ -25,7 +25,7 @@ public class TorBoxTorrentClient(ILogger logger, IHttpClien } var httpClient = httpClientFactory.CreateClient(); - httpClient.DefaultRequestHeaders.Add("User-Agent", $"rdt-client {Assembly.GetExecutingAssembly().GetName().Version}"); + httpClient.DefaultRequestHeaders.Add("User-Agent", $"rdt-client {Assembly.GetEntryAssembly()?.GetName().Version}"); httpClient.Timeout = TimeSpan.FromSeconds(Settings.Get.Provider.Timeout); var torBoxNetClient = new TorBoxNetClient(null, httpClient, 5);