remove empty creds restriction (#10)

* removed empty checks on qbit and deluge credentials

* updated configuration readme
This commit is contained in:
Marius Nechifor
2024-11-19 23:54:16 +02:00
committed by GitHub
parent cbc5c571b3
commit 54cabd98b4
4 changed files with 11 additions and 21 deletions
+6 -6
View File
@@ -134,16 +134,16 @@ services:
| CONTENTBLOCKER__BLACKLIST__PATH | Yes if whitelist is enabled | Path to the whitelist (local file or url); Needs to be json compatible | empty | | CONTENTBLOCKER__BLACKLIST__PATH | Yes if whitelist is enabled | Path to the whitelist (local file or url); Needs to be json compatible | empty |
||||| |||||
| QBITTORRENT__ENABLED | No | Enable or disable qBittorrent | true | | QBITTORRENT__ENABLED | No | Enable or disable qBittorrent | true |
| QBITTORRENT__URL | Yes if qBittorrent is enabled | qBittorrent instance url | http://localhost:8112 | | QBITTORRENT__URL | No | qBittorrent instance url | http://localhost:8112 |
| QBITTORRENT__USERNAME | Yes if qBittorrent is enabled | qBittorrent user | empty | | QBITTORRENT__USERNAME | No | qBittorrent user | empty |
| QBITTORRENT__PASSWORD | Yes if qBittorrent is enabled | qBittorrent password | empty | | QBITTORRENT__PASSWORD | No | qBittorrent password | empty |
||||| |||||
| DELUGE__ENABLED | No | Enable or disable Deluge | false | | DELUGE__ENABLED | No | Enable or disable Deluge | false |
| DELUGE__URL | Yes if Deluge is enabled | Deluge instance url | http://localhost:8080 | | DELUGE__URL | No | Deluge instance url | http://localhost:8080 |
| DELUGE__PASSWORD | Yes if Deluge is enabled | Deluge password | empty | | DELUGE__PASSWORD | No | Deluge password | empty |
||||| |||||
| TRANSMISSION__ENABLED | No | Enable or disable Transmission | true | | TRANSMISSION__ENABLED | No | Enable or disable Transmission | true |
| TRANSMISSION__URL | Yes if Transmission is enabled | Transmission instance url | http://localhost:9091 | | TRANSMISSION__URL | No | Transmission instance url | http://localhost:9091 |
| TRANSMISSION__USERNAME | No | Transmission user | empty | | TRANSMISSION__USERNAME | No | Transmission user | empty |
| TRANSMISSION__PASSWORD | No | Transmission password | empty | | TRANSMISSION__PASSWORD | No | Transmission password | empty |
||||| |||||
@@ -23,10 +23,5 @@ public sealed record DelugeConfig : IConfig
{ {
throw new ArgumentNullException(nameof(Url)); throw new ArgumentNullException(nameof(Url));
} }
if (string.IsNullOrEmpty(Password))
{
throw new ArgumentNullException(nameof(Password));
}
} }
} }
-10
View File
@@ -25,15 +25,5 @@ public sealed class QBitConfig : IConfig
{ {
throw new ArgumentNullException(nameof(Url)); throw new ArgumentNullException(nameof(Url));
} }
if (string.IsNullOrEmpty(Username))
{
throw new ArgumentNullException(nameof(Username));
}
if (string.IsNullOrEmpty(Password))
{
throw new ArgumentNullException(nameof(Password));
}
} }
} }
@@ -27,6 +27,11 @@ public sealed class QBitService : IDownloadService
public async Task LoginAsync() public async Task LoginAsync()
{ {
if (string.IsNullOrEmpty(_config.Username) && string.IsNullOrEmpty(_config.Password))
{
return;
}
await _client.LoginAsync(_config.Username, _config.Password); await _client.LoginAsync(_config.Username, _config.Password);
} }