include version when setting torbox api client useragent

This commit is contained in:
Cucumberrbob 2025-03-07 22:26:18 +00:00
parent a366328472
commit 818d9f06b2
No known key found for this signature in database
GPG key ID: 2B935C47401C3614

View file

@ -1,3 +1,4 @@
using System.Reflection;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using TorBoxNET;
@ -24,7 +25,7 @@ public class TorBoxTorrentClient(ILogger<TorBoxTorrentClient> 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);