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

@@ -67,4 +67,9 @@ public class LibraryDto
/// which does not change when the contents of an existing file are edited, and such edits could be missed while this setting is enabled.
/// </summary>
public bool ShouldSkipUnchangedDirectoriesDuringScan { get; set; } = false;
/// <summary>
/// Gets or sets the ordered parts of the template describing the structure of the media library on disk.
/// </summary>
public List<LibraryPathTemplatePartDto> PathTemplateParts { get; set; } = [];
}
@@ -0,0 +1,32 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for a path part available for a media library type.
/// </summary>
[DebuggerDisplay("Kind: {Kind}")]
public class LibraryPathPartDefinitionDto
{
/// <summary>
/// Gets or sets the kind of the path part.
/// </summary>
public string Kind { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the value type captured by the path part.
/// </summary>
public string ValueType { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the default representation of the path part.
/// </summary>
public string DefaultRepresentation { get; set; } = string.Empty;
/// <summary>
/// Gets or sets whether the path part is optional by default.
/// </summary>
public bool IsOptionalByDefault { get; set; }
}
@@ -0,0 +1,23 @@
#region ========================================================================= USING =====================================================================================
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for the path template catalog of a media library type.
/// </summary>
[DebuggerDisplay("Parts: {Parts.Count}; DefaultTemplateParts: {DefaultTemplateParts.Count}")]
public class LibraryPathTemplateCatalogDto
{
/// <summary>
/// Gets or sets the path parts that can be used in the path template of the library type.
/// </summary>
public List<LibraryPathPartDefinitionDto> Parts { get; set; } = [];
/// <summary>
/// Gets or sets the ordered parts of the default path template of the library type.
/// </summary>
public List<LibraryPathTemplatePartDto> DefaultTemplateParts { get; set; } = [];
}
@@ -0,0 +1,27 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for one part of the path template of a media library.
/// </summary>
[DebuggerDisplay("Kind: {Kind}; Representation: {Representation}")]
public class LibraryPathTemplatePartDto
{
/// <summary>
/// Gets or sets the kind of the path part.
/// </summary>
public string Kind { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the literal text or the value mask of the path part.
/// </summary>
public string Representation { get; set; } = string.Empty;
/// <summary>
/// Gets or sets whether the path part can be absent from the path.
/// </summary>
public bool IsOptional { get; set; }
}