Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 54cabd98b4 | |||
| cbc5c571b3 | |||
| beea640d49 |
@@ -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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,6 +77,17 @@ public sealed class ContentBlocker : IDisposable
|
|||||||
{
|
{
|
||||||
foreach (QueueRecord record in items)
|
foreach (QueueRecord record in items)
|
||||||
{
|
{
|
||||||
|
if (record.Protocol is not "torrent")
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(record.DownloadId))
|
||||||
|
{
|
||||||
|
_logger.LogDebug("skip | download id is null for {title}", record.Title);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
_logger.LogDebug("searching unwanted files for {title}", record.Title);
|
_logger.LogDebug("searching unwanted files for {title}", record.Title);
|
||||||
await _downloadService.BlockUnwantedFilesAsync(record.DownloadId);
|
await _downloadService.BlockUnwantedFilesAsync(record.DownloadId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user