You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
519 B
18 lines
519 B
using Recyclarr.Cli.Console.Settings;
|
|
|
|
namespace Recyclarr.Cli.Processors.Config;
|
|
|
|
public class ConfigCreationProcessor(IOrderedEnumerable<IConfigCreator> creators) : IConfigCreationProcessor
|
|
{
|
|
public void Process(ICreateConfigSettings settings)
|
|
{
|
|
var creator = creators.FirstOrDefault(x => x.CanHandle(settings));
|
|
if (creator is null)
|
|
{
|
|
throw new FatalException("Unable to determine which config creation logic to use");
|
|
}
|
|
|
|
creator.Create(settings);
|
|
}
|
|
}
|