Fix 8 design majors: optional ILogger in libraries, IndexFactoryService singleton threading, SharedMediaTypeRegistry, required TrackDto fields, GetExtensionType dedup, PagedResult zero-guard, TrackService null-return on failure

This commit is contained in:
Daniel Harvey
2026-05-17 16:57:03 -04:00
parent fc5b8de81a
commit 4bd3be2eb8
11 changed files with 99 additions and 68 deletions
@@ -1,5 +1,4 @@
using DeepDrftContent.Services.FileDatabase.Abstractions;
using DeepDrftContent.Services.FileDatabase.Models;
using DeepDrftContent.Services.FileDatabase.Models;
namespace DeepDrftContent.Services.FileDatabase.Services;
@@ -8,10 +7,13 @@ namespace DeepDrftContent.Services.FileDatabase.Services;
/// </summary>
public static class MediaVaultFactory
{
private static readonly IMediaTypeRegistry _registry = new SimpleMediaTypeRegistry();
public static async Task<MediaVault?> From(string rootPath, MediaVaultType mediaType)
public static async Task<MediaVault?> From(string rootPath, MediaVaultType mediaType, IndexFactoryService? factoryService = null)
{
return await _registry.CreateVaultAsync(mediaType, rootPath);
return mediaType switch
{
MediaVaultType.Image => await ImageVault.FromAsync(rootPath, factoryService),
MediaVaultType.Audio => await AudioVault.FromAsync(rootPath, factoryService),
_ => null
};
}
}