From 5ad8db1294ad6ac2b455e87a3696232b41c5121a Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Wed, 8 Jun 2022 08:36:22 -0500 Subject: [PATCH] fix: Do not throw when no instances are defined in YAML files Reason: Users may use a combination of YAML files, some may not have both radarr and sonarr config sections in them. We should gracefully pass over these to allow other configs to be processed. Should the final list still be empty, the program can gracefully exit having done no work. --- CHANGELOG.md | 4 ++++ src/Recyclarr/Config/ConfigurationLoader.cs | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49d9ff69..0b5ac81a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Do not exit when a YAML config has no sonarr or radarr section. + ## [2.2.0] - 2022-06-03 ### Added diff --git a/src/Recyclarr/Config/ConfigurationLoader.cs b/src/Recyclarr/Config/ConfigurationLoader.cs index ea5ce7ea..853e6686 100644 --- a/src/Recyclarr/Config/ConfigurationLoader.cs +++ b/src/Recyclarr/Config/ConfigurationLoader.cs @@ -61,11 +61,6 @@ public class ConfigurationLoader : IConfigurationLoader parser.SkipThisAndNestedEvents(); } - if (validConfigs.Count == 0) - { - throw new ConfigurationException(configSection, typeof(T), "There are no configured instances defined"); - } - return validConfigs; }