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.
30 lines
740 B
30 lines
740 B
using Recyclarr.Common.Extensions;
|
|
using Recyclarr.TrashGuide.CustomFormat;
|
|
|
|
namespace Recyclarr.Cli.Pipelines.CustomFormat.Models;
|
|
|
|
public class ProcessedCustomFormatCache : IPipelineCache
|
|
{
|
|
private readonly List<CustomFormatData> _customFormats = [];
|
|
|
|
public void AddCustomFormats(IEnumerable<CustomFormatData> customFormats)
|
|
{
|
|
_customFormats.AddRange(customFormats);
|
|
}
|
|
|
|
public void Clear()
|
|
{
|
|
_customFormats.Clear();
|
|
}
|
|
|
|
public CustomFormatData? LookupByTrashId(string trashId)
|
|
{
|
|
return _customFormats.Find(x => x.TrashId.EqualsIgnoreCase(trashId));
|
|
}
|
|
|
|
public CustomFormatData? LookupByServiceId(int id)
|
|
{
|
|
return _customFormats.Find(x => x.Id == id);
|
|
}
|
|
}
|