mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-02-05 11:31:49 -05:00
* refactored code added deluge support added transmission support added content blocker added blacklist and whitelist * increased level on some logs; updated test docker compose; updated dev appsettings * updated docker compose and readme * moved some logs * fixed env var typo; fixed sonarr and radarr default download client
39 lines
834 B
C#
39 lines
834 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));
|
|
}
|
|
|
|
if (string.IsNullOrEmpty(Username))
|
|
{
|
|
throw new ArgumentNullException(nameof(Username));
|
|
}
|
|
|
|
if (string.IsNullOrEmpty(Password))
|
|
{
|
|
throw new ArgumentNullException(nameof(Password));
|
|
}
|
|
}
|
|
} |