Merge pull request #13491 from gnattu/disallow-trailing-leading-space-library-name

Don't allow library name with leading or trailing space
This commit is contained in:
Niels van Velzen
2026-04-15 19:20:06 +02:00
committed by GitHub

View File

@@ -75,7 +75,9 @@ public class LibraryStructureController : BaseJellyfinApiController
[HttpPost]
[ProducesResponseType(StatusCodes.Status204NoContent)]
public async Task<ActionResult> AddVirtualFolder(
[FromQuery] string name,
[FromQuery]
[RegularExpression(@"^(?:\S(?:.*\S)?)$", ErrorMessage = "Library name cannot be empty or have leading/trailing spaces.")]
string name,
[FromQuery] CollectionTypeOptions? collectionType,
[FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] string[] paths,
[FromBody] AddVirtualFolderDto? libraryOptionsDto,