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.
28 lines
763 B
28 lines
763 B
using Recyclarr.TrashLib.Services.Sonarr.Config;
|
|
|
|
namespace Recyclarr.TrashLib.Services.ReleaseProfile.Filters;
|
|
|
|
public class IncludeExcludeFilter : IReleaseProfileFilter
|
|
{
|
|
private readonly ILogger _log;
|
|
private readonly ReleaseProfileDataFilterer _filterer;
|
|
|
|
public IncludeExcludeFilter(ILogger log)
|
|
{
|
|
_log = log;
|
|
_filterer = new ReleaseProfileDataFilterer(log);
|
|
}
|
|
|
|
public ReleaseProfileData Transform(ReleaseProfileData profile, ReleaseProfileConfig config)
|
|
{
|
|
if (config.Filter == null)
|
|
{
|
|
return profile;
|
|
}
|
|
|
|
_log.Debug("This profile will be filtered");
|
|
var newProfile = _filterer.FilterProfile(profile, config.Filter);
|
|
return newProfile ?? profile;
|
|
}
|
|
}
|