mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2025-12-31 01:48:49 -05:00
29 lines
578 B
C#
29 lines
578 B
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Common.Configuration;
|
|
|
|
public sealed class QBitConfig : IConfig
|
|
{
|
|
public const string SectionName = "qBittorrent";
|
|
|
|
public required bool Enabled { get; init; }
|
|
|
|
public Uri? Url { get; init; }
|
|
|
|
public string? Username { get; init; }
|
|
|
|
public string? Password { get; init; }
|
|
|
|
public void Validate()
|
|
{
|
|
if (!Enabled)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (Url is null)
|
|
{
|
|
throw new ArgumentNullException(nameof(Url));
|
|
}
|
|
}
|
|
} |