mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2025-12-23 22:18:39 -05:00
26 lines
614 B
C#
26 lines
614 B
C#
using Common.Exceptions;
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
namespace Common.Configuration.DownloadClient;
|
|
|
|
public record TransmissionConfig : IConfig
|
|
{
|
|
public const string SectionName = "Transmission";
|
|
|
|
public Uri? Url { get; init; }
|
|
|
|
[ConfigurationKeyName("URL_BASE")]
|
|
public string UrlBase { get; init; } = "transmission";
|
|
|
|
public string? Username { get; init; }
|
|
|
|
public string? Password { get; init; }
|
|
|
|
public void Validate()
|
|
{
|
|
if (Url is null)
|
|
{
|
|
throw new ValidationException($"{nameof(Url)} is empty");
|
|
}
|
|
}
|
|
} |