Adds dynamic path templates for media libraries, so that the scanner can derive the meaning of each path part

This commit is contained in:
BinaryAlley committed 2026-10-05 18:42:00 +03:00
1 parent 62b0e9297a
commit ca4f308b0a
86 files changed
+7406 -151

No files matched your search

@@ -45,6 +45,11 @@ public class LibraryEntity : IStorageEntity, IAuditableEntity
/// </summary>
public required ICollection<LibraryContentLocationEntity> ContentLocations { get; init; } = [];
/// <summary>
/// Gets the ordered parts of the template describing the structure of the media library on disk.
/// </summary>
public ICollection<LibraryPathTemplatePartEntity> PathTemplateParts { get; init; } = [];
/// <summary>
/// Gets the list of scans of the media library.
/// </summary>
@@ -87,6 +92,12 @@ public class LibraryEntity : IStorageEntity, IAuditableEntity
/// </summary>
public string? ArtworkProvidersConfigurationFingerprint { get; set; }
/// <summary>
/// Gets or sets the fingerprint of the path template of the media library, used to detect whether the template
/// changed since the last scan, and thus whether the metadata needs to be derived from the paths again.
/// </summary>
public string? PathTemplateFingerprint { get; set; }
/// <summary>
/// Gets the user that owns the media library.
/// </summary>
@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
/// <summary>
/// Repository entity for one part of the path template of a media library.
/// </summary>
[DebuggerDisplay("Kind: {Kind}; Position: {Position}")]
public class LibraryPathTemplatePartEntity
{
/// <summary>
/// Gets or sets the zero based position of the part in the path template.
/// </summary>
public required int Position { get; set; }
/// <summary>
/// Gets or sets the kind of the path part.
/// </summary>
public required LibraryPathPartKind Kind { get; set; }
/// <summary>
/// Gets or sets the literal text or the value mask of the path part.
/// </summary>
public required string Representation { get; set; }
/// <summary>
/// Gets or sets whether the path part can be absent from the path.
/// </summary>
public required bool IsOptional { get; set; }
}