FileDatabase Refactor and normalization

Test cleanup
This commit is contained in:
daniel-c-harvey
2025-09-04 17:27:28 -04:00
parent 6fefcbcfb5
commit 97ad4e3ac7
20 changed files with 373 additions and 393 deletions
@@ -8,20 +8,30 @@ namespace DeepDrftContent.FileDatabase.Abstractions;
/// </summary>
public interface IIndexFactory
{
/// <summary>
/// Creates an index of the specified type
/// </summary>
Task<IIndex?> CreateIndexAsync(IndexType type, string rootPath);
/// <summary>
/// Loads an existing index of the specified type
/// </summary>
Task<IIndex?> LoadIndexAsync(IndexType type, string rootPath);
/// <summary>
/// Loads existing index or creates new one if loading fails
/// Creates a directory index
/// </summary>
Task<IIndex?> LoadOrCreateIndexAsync(IndexType type, string rootPath);
Task<IDirectoryIndex?> CreateDirectoryIndexAsync(string rootPath);
/// <summary>
/// Loads existing directory index or creates new one if loading fails
/// </summary>
Task<IDirectoryIndex?> LoadOrCreateDirectoryIndexAsync(string rootPath);
/// <summary>
/// Creates a vault index with the specified vault type
/// </summary>
Task<IVaultIndex?> CreateVaultIndexAsync(string rootPath, MediaVaultType vaultType);
/// <summary>
/// Loads existing vault index or creates new one with the specified vault type if loading fails
/// </summary>
Task<IVaultIndex?> LoadOrCreateVaultIndexAsync(string rootPath, MediaVaultType vaultType);
}
/// <summary>
@@ -66,4 +66,14 @@ public interface IMediaTypeRegistry
/// Get the metadata type for a vault type
/// </summary>
Type GetMetaDataType(MediaVaultType vaultType);
/// <summary>
/// Get the vault type for a binary type (reverse mapping)
/// </summary>
MediaVaultType GetVaultType(Type binaryType);
/// <summary>
/// Get the vault type for a binary type using generics (reverse mapping)
/// </summary>
MediaVaultType GetVaultType<T>() where T : FileBinary;
}