mirror of
https://github.com/lantean-code/qbtmud.git
synced 2025-10-22 20:42:24 +00:00
Add options
This commit is contained in:
@@ -126,6 +126,24 @@ namespace Lantean.QBitTorrentClient
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
public async Task<IReadOnlyList<NetworkInterface>> GetNetworkInterfaces()
|
||||
{
|
||||
var response = await _httpClient.GetAsync("app/networkInterfaceList");
|
||||
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
return await GetJsonList<NetworkInterface>(response.Content);
|
||||
}
|
||||
|
||||
public async Task<IReadOnlyList<string>> GetNetworkInterfaceAddressList(string @interface)
|
||||
{
|
||||
var response = await _httpClient.GetAsync($"app/networkInterfaceAddressList?iface={@interface}");
|
||||
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
return await GetJsonList<string>(response.Content);
|
||||
}
|
||||
|
||||
#endregion Application
|
||||
|
||||
#region Log
|
||||
@@ -915,6 +933,11 @@ namespace Lantean.QBitTorrentClient
|
||||
response.EnsureSuccessStatusCode();
|
||||
}
|
||||
|
||||
public Task<string> GetExportUrl(string hash)
|
||||
{
|
||||
return Task.FromResult($"{_httpClient.BaseAddress}torrents/export?hash={hash}");
|
||||
}
|
||||
|
||||
#endregion Torrent management
|
||||
|
||||
#region RSS
|
||||
|
||||
@@ -30,6 +30,10 @@ namespace Lantean.QBitTorrentClient
|
||||
|
||||
Task<string> GetDefaultSavePath();
|
||||
|
||||
Task<IReadOnlyList<NetworkInterface>> GetNetworkInterfaces();
|
||||
|
||||
Task<IReadOnlyList<string>> GetNetworkInterfaceAddressList(string @interface);
|
||||
|
||||
#endregion Application
|
||||
|
||||
#region Log
|
||||
@@ -162,6 +166,8 @@ namespace Lantean.QBitTorrentClient
|
||||
|
||||
Task RenameFolder(string hash, string oldPath, string newPath);
|
||||
|
||||
Task<string> GetExportUrl(string hash);
|
||||
|
||||
#endregion Torrent management
|
||||
|
||||
#region RSS
|
||||
|
||||
@@ -76,6 +76,11 @@ namespace Lantean.QBitTorrentClient
|
||||
return _apiClient.EditTracker(hash, originalUrl, newUrl);
|
||||
}
|
||||
|
||||
public Task<string> GetExportUrl(string hash)
|
||||
{
|
||||
return _apiClient.GetExportUrl(hash);
|
||||
}
|
||||
|
||||
public Task<IReadOnlyDictionary<string, Category>> GetAllCategories()
|
||||
{
|
||||
return _apiClient.GetAllCategories();
|
||||
@@ -116,6 +121,16 @@ namespace Lantean.QBitTorrentClient
|
||||
return _apiClient.GetDefaultSavePath();
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<NetworkInterface>> GetNetworkInterfaces()
|
||||
{
|
||||
return _apiClient.GetNetworkInterfaces();
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<string>> GetNetworkInterfaceAddressList(string @interface)
|
||||
{
|
||||
return _apiClient.GetNetworkInterfaceAddressList(@interface);
|
||||
}
|
||||
|
||||
public Task<long> GetGlobalDownloadLimit()
|
||||
{
|
||||
return _apiClient.GetGlobalDownloadLimit();
|
||||
|
||||
22
Lantean.QBitTorrentClient/Models/NetworkInterface.cs
Normal file
22
Lantean.QBitTorrentClient/Models/NetworkInterface.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lantean.QBitTorrentClient.Models
|
||||
{
|
||||
public record NetworkInterface
|
||||
{
|
||||
[JsonConstructor]
|
||||
public NetworkInterface(
|
||||
string name,
|
||||
string value)
|
||||
{
|
||||
Name = name;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; }
|
||||
|
||||
[JsonPropertyName("value")]
|
||||
public string Value { get; }
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
bool announceToAllTiers,
|
||||
bool announceToAllTrackers,
|
||||
bool anonymousMode,
|
||||
string appInstanceName,
|
||||
int asyncIoThreads,
|
||||
int autoDeleteMode,
|
||||
bool autoTmmEnabled,
|
||||
@@ -39,6 +40,7 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
string currentInterfaceName,
|
||||
string currentNetworkInterface,
|
||||
bool dht,
|
||||
string dhtBootstrapNodes,
|
||||
int diskCache,
|
||||
int diskCacheTtl,
|
||||
int diskIoReadMode,
|
||||
@@ -100,6 +102,7 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
string mailNotificationSmtp,
|
||||
bool mailNotificationSslEnabled,
|
||||
string mailNotificationUsername,
|
||||
bool markOfTheWeb,
|
||||
int maxActiveCheckingTorrents,
|
||||
int maxActiveDownloads,
|
||||
int maxActiveTorrents,
|
||||
@@ -138,6 +141,7 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
bool proxyRss,
|
||||
string proxyType,
|
||||
string proxyUsername,
|
||||
string pythonExecutablePath,
|
||||
bool queueingEnabled,
|
||||
bool randomPort,
|
||||
bool reannounceWhenAddressChanged,
|
||||
@@ -147,6 +151,7 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
bool resolvePeerCountries,
|
||||
string resumeDataStorageType,
|
||||
bool rssAutoDownloadingEnabled,
|
||||
long rssFetchDelay,
|
||||
bool rssDownloadRepackProperEpisodes,
|
||||
int rssMaxArticlesPerFeed,
|
||||
bool rssProcessingEnabled,
|
||||
@@ -207,7 +212,8 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
int webUiSessionTimeout,
|
||||
bool webUiUpnp,
|
||||
bool webUiUseCustomHttpHeadersEnabled,
|
||||
string webUiUsername
|
||||
string webUiUsername,
|
||||
string webUiPassword
|
||||
)
|
||||
{
|
||||
AddToTopOfQueue = addToTopOfQueue;
|
||||
@@ -221,6 +227,7 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
AnnounceToAllTiers = announceToAllTiers;
|
||||
AnnounceToAllTrackers = announceToAllTrackers;
|
||||
AnonymousMode = anonymousMode;
|
||||
AppInstanceName = appInstanceName;
|
||||
AsyncIoThreads = asyncIoThreads;
|
||||
AutoDeleteMode = autoDeleteMode;
|
||||
AutoTmmEnabled = autoTmmEnabled;
|
||||
@@ -243,6 +250,7 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
CurrentInterfaceName = currentInterfaceName;
|
||||
CurrentNetworkInterface = currentNetworkInterface;
|
||||
Dht = dht;
|
||||
DhtBootstrapNodes = dhtBootstrapNodes;
|
||||
DiskCache = diskCache;
|
||||
DiskCacheTtl = diskCacheTtl;
|
||||
DiskIoReadMode = diskIoReadMode;
|
||||
@@ -304,6 +312,7 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
MailNotificationSmtp = mailNotificationSmtp;
|
||||
MailNotificationSslEnabled = mailNotificationSslEnabled;
|
||||
MailNotificationUsername = mailNotificationUsername;
|
||||
MarkOfTheWeb = markOfTheWeb;
|
||||
MaxActiveCheckingTorrents = maxActiveCheckingTorrents;
|
||||
MaxActiveDownloads = maxActiveDownloads;
|
||||
MaxActiveTorrents = maxActiveTorrents;
|
||||
@@ -342,6 +351,7 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
ProxyRss = proxyRss;
|
||||
ProxyType = proxyType;
|
||||
ProxyUsername = proxyUsername;
|
||||
PythonExecutablePath = pythonExecutablePath;
|
||||
QueueingEnabled = queueingEnabled;
|
||||
RandomPort = randomPort;
|
||||
ReannounceWhenAddressChanged = reannounceWhenAddressChanged;
|
||||
@@ -352,6 +362,7 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
ResumeDataStorageType = resumeDataStorageType;
|
||||
RssAutoDownloadingEnabled = rssAutoDownloadingEnabled;
|
||||
RssDownloadRepackProperEpisodes = rssDownloadRepackProperEpisodes;
|
||||
RssFetchDelay = rssFetchDelay;
|
||||
RssMaxArticlesPerFeed = rssMaxArticlesPerFeed;
|
||||
RssProcessingEnabled = rssProcessingEnabled;
|
||||
RssRefreshInterval = rssRefreshInterval;
|
||||
@@ -412,6 +423,7 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
WebUiUpnp = webUiUpnp;
|
||||
WebUiUseCustomHttpHeadersEnabled = webUiUseCustomHttpHeadersEnabled;
|
||||
WebUiUsername = webUiUsername;
|
||||
WebUiPassword = webUiPassword;
|
||||
}
|
||||
|
||||
[JsonPropertyName("add_to_top_of_queue")]
|
||||
@@ -447,6 +459,9 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
[JsonPropertyName("anonymous_mode")]
|
||||
public bool AnonymousMode { get; }
|
||||
|
||||
[JsonPropertyName("app_instance_name")]
|
||||
public string AppInstanceName { get; }
|
||||
|
||||
[JsonPropertyName("async_io_threads")]
|
||||
public int AsyncIoThreads { get; }
|
||||
|
||||
@@ -513,6 +528,9 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
[JsonPropertyName("dht")]
|
||||
public bool Dht { get; }
|
||||
|
||||
[JsonPropertyName("dht_bootstrap_nodes")]
|
||||
public string DhtBootstrapNodes { get; }
|
||||
|
||||
[JsonPropertyName("disk_cache")]
|
||||
public int DiskCache { get; }
|
||||
|
||||
@@ -696,6 +714,9 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
[JsonPropertyName("mail_notification_username")]
|
||||
public string MailNotificationUsername { get; }
|
||||
|
||||
[JsonPropertyName("mark_of_the_web")]
|
||||
public bool MarkOfTheWeb { get; }
|
||||
|
||||
[JsonPropertyName("max_active_checking_torrents")]
|
||||
public int MaxActiveCheckingTorrents { get; }
|
||||
|
||||
@@ -810,6 +831,9 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
[JsonPropertyName("proxy_username")]
|
||||
public string ProxyUsername { get; }
|
||||
|
||||
[JsonPropertyName("python_executable_path")]
|
||||
public string PythonExecutablePath { get; }
|
||||
|
||||
[JsonPropertyName("queueing_enabled")]
|
||||
public bool QueueingEnabled { get; }
|
||||
|
||||
@@ -840,6 +864,9 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
[JsonPropertyName("rss_download_repack_proper_episodes")]
|
||||
public bool RssDownloadRepackProperEpisodes { get; }
|
||||
|
||||
[JsonPropertyName("rss_fetch_delay")]
|
||||
public long RssFetchDelay { get; }
|
||||
|
||||
[JsonPropertyName("rss_max_articles_per_feed")]
|
||||
public int RssMaxArticlesPerFeed { get; }
|
||||
|
||||
@@ -1019,5 +1046,8 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
|
||||
[JsonPropertyName("web_ui_username")]
|
||||
public string WebUiUsername { get; }
|
||||
|
||||
[JsonPropertyName("web_ui_password")]
|
||||
public string WebUiPassword { get; }
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,9 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
[JsonPropertyName("anonymous_mode")]
|
||||
public bool? AnonymousMode { get; set; }
|
||||
|
||||
[JsonPropertyName("app_instance_name")]
|
||||
public string? AppInstanceName { get; set; }
|
||||
|
||||
[JsonPropertyName("async_io_threads")]
|
||||
public int? AsyncIoThreads { get; set; }
|
||||
|
||||
@@ -103,6 +106,9 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
[JsonPropertyName("dht")]
|
||||
public bool? Dht { get; set; }
|
||||
|
||||
[JsonPropertyName("dht_bootstrap_nodes")]
|
||||
public string? DhtBootstrapNodes { get; set; }
|
||||
|
||||
[JsonPropertyName("disk_cache")]
|
||||
public int? DiskCache { get; set; }
|
||||
|
||||
@@ -286,6 +292,9 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
[JsonPropertyName("mail_notification_username")]
|
||||
public string? MailNotificationUsername { get; set; }
|
||||
|
||||
[JsonPropertyName("mark_of_the_web")]
|
||||
public bool? MarkOfTheWeb { get; set; }
|
||||
|
||||
[JsonPropertyName("max_active_checking_torrents")]
|
||||
public int? MaxActiveCheckingTorrents { get; set; }
|
||||
|
||||
@@ -400,6 +409,9 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
[JsonPropertyName("proxy_username")]
|
||||
public string? ProxyUsername { get; set; }
|
||||
|
||||
[JsonPropertyName("python_executable_path")]
|
||||
public string? PythonExecutablePath { get; set; }
|
||||
|
||||
[JsonPropertyName("queueing_enabled")]
|
||||
public bool? QueueingEnabled { get; set; }
|
||||
|
||||
@@ -430,6 +442,9 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
[JsonPropertyName("rss_download_repack_proper_episodes")]
|
||||
public bool? RssDownloadRepackProperEpisodes { get; set; }
|
||||
|
||||
[JsonPropertyName("rss_fetch_delay")]
|
||||
public long? RssFetchDelay { get; set; }
|
||||
|
||||
[JsonPropertyName("rss_max_articles_per_feed")]
|
||||
public int? RssMaxArticlesPerFeed { get; set; }
|
||||
|
||||
@@ -609,5 +624,8 @@ namespace Lantean.QBitTorrentClient.Models
|
||||
|
||||
[JsonPropertyName("web_ui_username")]
|
||||
public string? WebUiUsername { get; set; }
|
||||
|
||||
[JsonPropertyName("web_ui_password")]
|
||||
public string? WebUiPassword { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user