From 1034f342edb85cbf0a1a1492b22e9242a9b47eee Mon Sep 17 00:00:00 2001 From: Cucumberrbob <128094686+Cucumberrbob@users.noreply.github.com> Date: Thu, 6 Mar 2025 19:57:10 +0000 Subject: [PATCH] Update torrent state to error when all files excluded by filters. Only affects PM, TB and DL --- server/RdtClient.Service/Services/Torrents.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/server/RdtClient.Service/Services/Torrents.cs b/server/RdtClient.Service/Services/Torrents.cs index 3b2bb21..a88087a 100644 --- a/server/RdtClient.Service/Services/Torrents.cs +++ b/server/RdtClient.Service/Services/Torrents.cs @@ -242,6 +242,20 @@ public class Torrents( return; } + if (downloadLinks.Count == 0) + { + logger.LogInformation("All files excluded by filters (IncludeRegex: {includeRegex}, ExcludeRegex: {excludeRegex}, DownloadMinSize: {downloadMinSize} {torrentInfo}", + torrent.IncludeRegex, + torrent.ExcludeRegex, + torrent.DownloadMinSize, + torrent.ToLog()); + + await torrentData.UpdateRetry(torrentId, null, torrent.TorrentRetryAttempts); + await torrentData.UpdateComplete(torrentId, "All files excluded", DateTimeOffset.Now, false); + + return; + } + foreach (var downloadLink in downloadLinks) { // Make sure downloads don't get added multiple times