Files
Cleanuparr/code/Common/Configuration/DownloadClient/QBitConfig.cs
2025-03-20 00:09:24 +02:00

26 lines
609 B
C#

using Common.Exceptions;
using Microsoft.Extensions.Configuration;
namespace Common.Configuration.DownloadClient;
public sealed class QBitConfig : IConfig
{
public const string SectionName = "qBittorrent";
public Uri? Url { get; init; }
[ConfigurationKeyName("URL_BASE")]
public string UrlBase { get; init; } = string.Empty;
public string? Username { get; init; }
public string? Password { get; init; }
public void Validate()
{
if (Url is null)
{
throw new ValidationException($"{nameof(Url)} is empty");
}
}
}