From a79a60a3393253e3ccfdd071d893725afabbbcdd Mon Sep 17 00:00:00 2001 From: Flaminel Date: Wed, 17 Jun 2026 15:27:32 +0300 Subject: [PATCH] fixed ignored downloads bloating with each run --- .../Features/Jobs/DownloadCleaner.cs | 5 +++-- .../Features/Jobs/MalwareBlocker.cs | 5 +++-- .../Cleanuparr.Infrastructure/Features/Jobs/QueueCleaner.cs | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/code/backend/Cleanuparr.Infrastructure/Features/Jobs/DownloadCleaner.cs b/code/backend/Cleanuparr.Infrastructure/Features/Jobs/DownloadCleaner.cs index 86f9e75e..ba0de4e4 100644 --- a/code/backend/Cleanuparr.Infrastructure/Features/Jobs/DownloadCleaner.cs +++ b/code/backend/Cleanuparr.Infrastructure/Features/Jobs/DownloadCleaner.cs @@ -87,8 +87,9 @@ public sealed class DownloadCleaner : GenericHandler { DownloadCleanerConfig config = ContextProvider.Get(); - List ignoredDownloads = ContextProvider.Get(nameof(GeneralConfig)).IgnoredDownloads; - ignoredDownloads.AddRange(config.IgnoredDownloads); + List ignoredDownloads = ContextProvider.Get(nameof(GeneralConfig)).IgnoredDownloads + .Concat(config.IgnoredDownloads) + .ToList(); Dictionary> downloadServiceToDownloadsMap = new(); List loggedInServices = new(); diff --git a/code/backend/Cleanuparr.Infrastructure/Features/Jobs/MalwareBlocker.cs b/code/backend/Cleanuparr.Infrastructure/Features/Jobs/MalwareBlocker.cs index ea7fe43c..4f80190d 100644 --- a/code/backend/Cleanuparr.Infrastructure/Features/Jobs/MalwareBlocker.cs +++ b/code/backend/Cleanuparr.Infrastructure/Features/Jobs/MalwareBlocker.cs @@ -147,8 +147,9 @@ public sealed class MalwareBlocker : GenericHandler private async Task ScanInstanceAsync(ArrInstance instance, WebhookScanTarget? target = null) { - List ignoredDownloads = ContextProvider.Get(nameof(GeneralConfig)).IgnoredDownloads; - ignoredDownloads.AddRange(ContextProvider.Get().IgnoredDownloads); + List ignoredDownloads = ContextProvider.Get(nameof(GeneralConfig)).IgnoredDownloads + .Concat(ContextProvider.Get().IgnoredDownloads) + .ToList(); using var _ = LogContext.PushProperty(LogProperties.Category, instance.ArrConfig.Type.ToString()); using var _2 = LogContext.PushProperty(LogProperties.InstanceName, instance.Name); diff --git a/code/backend/Cleanuparr.Infrastructure/Features/Jobs/QueueCleaner.cs b/code/backend/Cleanuparr.Infrastructure/Features/Jobs/QueueCleaner.cs index b74824c8..608d9fa8 100644 --- a/code/backend/Cleanuparr.Infrastructure/Features/Jobs/QueueCleaner.cs +++ b/code/backend/Cleanuparr.Infrastructure/Features/Jobs/QueueCleaner.cs @@ -81,9 +81,10 @@ public sealed class QueueCleaner : GenericHandler protected override async Task ProcessInstanceAsync(ArrInstance instance) { - List ignoredDownloads = ContextProvider.Get(nameof(GeneralConfig)).IgnoredDownloads; QueueCleanerConfig queueCleanerConfig = ContextProvider.Get(); - ignoredDownloads.AddRange(queueCleanerConfig.IgnoredDownloads); + List ignoredDownloads = ContextProvider.Get(nameof(GeneralConfig)).IgnoredDownloads + .Concat(queueCleanerConfig.IgnoredDownloads) + .ToList(); using var _ = LogContext.PushProperty(LogProperties.Category, instance.ArrConfig.Type.ToString()); using var _2 = LogContext.PushProperty(LogProperties.InstanceName, instance.Name);