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.
22 lines
622 B
22 lines
622 B
using System.IO.Abstractions;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Recyclarr.TrashLib.Json;
|
|
|
|
public class ServiceJsonLoader : IBulkJsonLoader
|
|
{
|
|
private readonly IBulkJsonLoader _loader;
|
|
|
|
public ServiceJsonLoader(Func<JsonSerializerSettings, IBulkJsonLoader> jsonLoaderFactory)
|
|
{
|
|
_loader = jsonLoaderFactory(GlobalJsonSerializerSettings.Services);
|
|
}
|
|
|
|
public ICollection<T> LoadAllFilesAtPaths<T>(
|
|
IEnumerable<IDirectoryInfo> jsonPaths,
|
|
Func<IObservable<LoadedJsonObject<T>>, IObservable<T>>? extra = null)
|
|
{
|
|
return _loader.LoadAllFilesAtPaths(jsonPaths, extra);
|
|
}
|
|
}
|