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.
19 lines
529 B
19 lines
529 B
using Newtonsoft.Json;
|
|
using Recyclarr.TrashLib.Models;
|
|
|
|
namespace Recyclarr.Cli.Pipelines.CustomFormat.Guide;
|
|
|
|
public class CustomFormatParser : ICustomFormatParser
|
|
{
|
|
public CustomFormatData ParseCustomFormatData(string guideData, string fileName)
|
|
{
|
|
var cf = JsonConvert.DeserializeObject<CustomFormatData>(guideData);
|
|
if (cf is null)
|
|
{
|
|
throw new JsonSerializationException($"Unable to parse JSON at file {fileName}");
|
|
}
|
|
|
|
return cf with {FileName = fileName};
|
|
}
|
|
}
|