Usenet streaming with a WebDAV server and a SABnzbd-compatible API
C#
Support per-category health checks during queue processing.
nzbdav-dev35139dbee12b
diff --git a/backend/Config/ConfigManager.cs b/backend/Config/ConfigManager.csindex 2c3c3ce9..d03be208 100644--- a/backend/Config/ConfigManager.cs+++ b/backend/Config/ConfigManager.cs@@ -155,11 +155,14 @@ public class ConfigManagerreturn (configValue != null ? bool.Parse(configValue) : defaultValue);}- public bool IsEnsureArticleExistenceEnabled()+ public HashSet<string> GetEnsureArticleExistenceCategories(){- var defaultValue = false;- var configValue = StringUtil.EmptyToNull(GetConfigValue("api.ensure-article-existence"));- return (configValue != null ? bool.Parse(configValue) : defaultValue);+ var configValue = GetConfigValue("api.ensure-article-existence-categories");+ return (configValue ?? "").Split(',')+ .Select(x => x.Trim())+ .Select(x => x.ToLower())+ .Where(x => !string.IsNullOrWhiteSpace(x))+ .ToHashSet();}public bool IsPreviewPar2FilesEnabled()diff --git a/backend/Queue/QueueItemProcessor.cs b/backend/Queue/QueueItemProcessor.csindex 03990df7..d53bf268 100644--- a/backend/Queue/QueueItemProcessor.cs+++ b/backend/Queue/QueueItemProcessor.cs@@ -148,7 +148,8 @@ public class QueueItemProcessor(// step 3 -- Optionally check full article existencevar checkedFullHealth = false;- if (configManager.IsEnsureArticleExistenceEnabled())+ var healthCheckCategories = configManager.GetEnsureArticleExistenceCategories();+ if (healthCheckCategories.Contains(queueItem.Category.ToLower())){var articlesToCheck = fileInfos.Where(x => x.IsRar || FilenameUtil.IsImportantFileType(x.FileName))