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

@@ -28,6 +28,7 @@ public class AddLibraryRequestFixture
/// <param name="canDownloadMetadataFromWeb">Optional. Whether metadata should be downloaded from the web.</param>
/// <param name="shouldSaveMetadataInMediaDirectories">Optional. Whether metadata should be saved in the media directories.</param>
/// <param name="shouldSkipUnchangedDirectoriesDuringScan">Optional. Whether unchanged directories should be skipped during scan.</param>
/// <param name="pathTemplateParts">Optional. The ordered parts of the path template of the media library.</param>
/// <returns>The created <see cref="AddLibraryRequest"/>.</returns>
public AddLibraryRequest Create(
string? title = null,
@@ -38,7 +39,8 @@ public class AddLibraryRequestFixture
bool? isLocked = null,
bool? canDownloadMetadataFromWeb = null,
bool? shouldSaveMetadataInMediaDirectories = null,
bool? shouldSkipUnchangedDirectoriesDuringScan = null)
bool? shouldSkipUnchangedDirectoriesDuringScan = null,
LibraryPathTemplatePartRequest[]? pathTemplateParts = null)
{
return new AddLibraryRequest(
title ?? _faker.Commerce.Department(),
@@ -49,7 +51,8 @@ public class AddLibraryRequestFixture
isLocked ?? _faker.Random.Bool(),
canDownloadMetadataFromWeb ?? _faker.Random.Bool(),
shouldSaveMetadataInMediaDirectories ?? _faker.Random.Bool(),
shouldSkipUnchangedDirectoriesDuringScan ?? _faker.Random.Bool()
shouldSkipUnchangedDirectoriesDuringScan ?? _faker.Random.Bool(),
pathTemplateParts
);
}
@@ -31,6 +31,7 @@ public class UpdateLibraryRequestFixture
/// <param name="canDownloadMetadataFromWeb">Optional. Whether metadata should be downloaded from the web.</param>
/// <param name="shouldSaveMetadataInMediaDirectories">Optional. Whether metadata should be saved in the media directories.</param>
/// <param name="shouldSkipUnchangedDirectoriesDuringScan">Optional. Whether unchanged directories should be skipped during scan.</param>
/// <param name="pathTemplateParts">Optional. The ordered parts of the path template of the media library.</param>
/// <returns>The created <see cref="UpdateLibraryRequest"/>.</returns>
public UpdateLibraryRequest Create(
Guid? id = null,
@@ -43,7 +44,8 @@ public class UpdateLibraryRequestFixture
bool? isLocked = null,
bool? canDownloadMetadataFromWeb = null,
bool? shouldSaveMetadataInMediaDirectories = null,
bool? shouldSkipUnchangedDirectoriesDuringScan = null)
bool? shouldSkipUnchangedDirectoriesDuringScan = null,
LibraryPathTemplatePartRequest[]? pathTemplateParts = null)
{
return new UpdateLibraryRequest(
id ?? _faker.Random.Guid(),
@@ -56,7 +58,8 @@ public class UpdateLibraryRequestFixture
isLocked ?? _faker.Random.Bool(),
canDownloadMetadataFromWeb ?? _faker.Random.Bool(),
shouldSaveMetadataInMediaDirectories ?? _faker.Random.Bool(),
shouldSkipUnchangedDirectoriesDuringScan ?? _faker.Random.Bool()
shouldSkipUnchangedDirectoriesDuringScan ?? _faker.Random.Bool(),
pathTemplateParts
);
}
@@ -32,6 +32,7 @@ public class LibraryResponseFixture
/// <param name="canDownloadMetadataFromWeb">Optional. Whether metadata should be downloaded from the web.</param>
/// <param name="shouldSaveMetadataInMediaDirectories">Optional. Whether metadata should be saved in the media directories.</param>
/// <param name="shouldSkipUnchangedDirectoriesDuringScan">Optional. Whether unchanged directories should be skipped during scan.</param>
/// <param name="pathTemplateParts">Optional. The ordered parts of the path template of the media library.</param>
/// <param name="createdOnUtc">Optional. The date and time when the library was created.</param>
/// <param name="updatedOnUtc">Optional. The date and time when the library was updated.</param>
/// <returns>The created <see cref="LibraryResponse"/>.</returns>
@@ -47,6 +48,7 @@ public class LibraryResponseFixture
bool? canDownloadMetadataFromWeb = null,
bool? shouldSaveMetadataInMediaDirectories = null,
bool? shouldSkipUnchangedDirectoriesDuringScan = null,
List<LibraryPathTemplatePartResponse>? pathTemplateParts = null,
DateTime? createdOnUtc = null,
DateTime? updatedOnUtc = null)
{
@@ -62,6 +64,7 @@ public class LibraryResponseFixture
canDownloadMetadataFromWeb ?? _faker.Random.Bool(),
shouldSaveMetadataInMediaDirectories ?? _faker.Random.Bool(),
shouldSkipUnchangedDirectoriesDuringScan ?? _faker.Random.Bool(),
pathTemplateParts ?? [],
createdOnUtc ?? _faker.Date.Past().ToUniversalTime(),
updatedOnUtc
);