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.
recyclarr/src/TrashLib/Radarr/CustomFormat/Processors/PersistenceSteps/CustomFormatApiPersistenceS...

25 lines
707 B

using TrashLib.Radarr.CustomFormat.Api;
namespace TrashLib.Radarr.CustomFormat.Processors.PersistenceSteps;
internal class CustomFormatApiPersistenceStep : ICustomFormatApiPersistenceStep
{
public async Task Process(ICustomFormatService api, CustomFormatTransactionData transactions)
{
foreach (var cf in transactions.NewCustomFormats)
{
await api.CreateCustomFormat(cf);
}
foreach (var cf in transactions.UpdatedCustomFormats)
{
await api.UpdateCustomFormat(cf);
}
foreach (var cfId in transactions.DeletedCustomFormatIds)
{
await api.DeleteCustomFormat(cfId.CustomFormatId);
}
}
}