mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-01-01 10:28:11 -05:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb438f2ca7 |
@@ -168,9 +168,7 @@ public sealed class DelugeClient
|
||||
content.Headers.ContentType = new MediaTypeWithQualityHeaderValue("application/json");
|
||||
|
||||
UriBuilder uriBuilder = new(_config.Url);
|
||||
uriBuilder.Path = string.IsNullOrEmpty(_config.UrlBase)
|
||||
? $"{uriBuilder.Path.TrimEnd('/')}/json"
|
||||
: $"{uriBuilder.Path.TrimEnd('/')}/{_config.UrlBase.TrimStart('/').TrimEnd('/')}/json";
|
||||
uriBuilder.Path = $"{uriBuilder.Path.TrimEnd('/')}/json";
|
||||
var responseMessage = await _httpClient.PostAsync(uriBuilder.Uri, content);
|
||||
responseMessage.EnsureSuccessStatusCode();
|
||||
|
||||
|
||||
@@ -53,9 +53,7 @@ public partial class TransmissionService : DownloadService, ITransmissionService
|
||||
)
|
||||
{
|
||||
UriBuilder uriBuilder = new(_downloadClientConfig.Url);
|
||||
uriBuilder.Path = string.IsNullOrEmpty(_downloadClientConfig.UrlBase)
|
||||
? $"{uriBuilder.Path.TrimEnd('/')}/rpc"
|
||||
: $"{uriBuilder.Path.TrimEnd('/')}/{_downloadClientConfig.UrlBase.TrimStart('/').TrimEnd('/')}/rpc";
|
||||
uriBuilder.Path = $"{uriBuilder.Path.TrimEnd('/')}/rpc";
|
||||
_client = new Client(
|
||||
_httpClient,
|
||||
uriBuilder.Uri.ToString(),
|
||||
|
||||
@@ -363,8 +363,9 @@ export class DownloadClientSettingsComponent implements OnDestroy, CanComponentD
|
||||
const clientType = this.clientForm.get('type')?.value;
|
||||
const hostControl = this.clientForm.get('host');
|
||||
const usernameControl = this.clientForm.get('username');
|
||||
const urlBaseControl = this.clientForm.get('urlBase');
|
||||
|
||||
if (!hostControl || !usernameControl) return;
|
||||
if (!hostControl || !usernameControl || !urlBaseControl) return;
|
||||
|
||||
hostControl.setValidators([
|
||||
Validators.required,
|
||||
@@ -377,6 +378,11 @@ export class DownloadClientSettingsComponent implements OnDestroy, CanComponentD
|
||||
usernameControl.clearValidators();
|
||||
}
|
||||
|
||||
// Set default URL base for Transmission
|
||||
if (clientType === DownloadClientType.Transmission) {
|
||||
urlBaseControl.setValue('transmission');
|
||||
}
|
||||
|
||||
// Update validation state
|
||||
hostControl.updateValueAndValidity();
|
||||
usernameControl.updateValueAndValidity();
|
||||
|
||||
Reference in New Issue
Block a user