diff options
| author | Bond-009 <bond.009@outlook.com> | 2024-04-17 18:44:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-17 10:44:50 -0600 |
| commit | bb018c4adc7916fafb7dac2db9a902be8d20e75d (patch) | |
| tree | eb15d41547a4cf5a1753ff4f70bea581152b15db /Jellyfin.Api/Controllers/LibraryStructureController.cs | |
| parent | 356e05e3af7702b7dfefbba6e936d602c3638055 (diff) | |
Enable nullable for LibraryManager (#11191)
Diffstat (limited to 'Jellyfin.Api/Controllers/LibraryStructureController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/LibraryStructureController.cs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Jellyfin.Api/Controllers/LibraryStructureController.cs b/Jellyfin.Api/Controllers/LibraryStructureController.cs index c1d01a5c2..f685eeaa0 100644 --- a/Jellyfin.Api/Controllers/LibraryStructureController.cs +++ b/Jellyfin.Api/Controllers/LibraryStructureController.cs @@ -75,7 +75,7 @@ public class LibraryStructureController : BaseJellyfinApiController [HttpPost] [ProducesResponseType(StatusCodes.Status204NoContent)] public async Task<ActionResult> AddVirtualFolder( - [FromQuery] string? name, + [FromQuery] string name, [FromQuery] CollectionTypeOptions? collectionType, [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] string[] paths, [FromBody] AddVirtualFolderDto? libraryOptionsDto, @@ -103,7 +103,7 @@ public class LibraryStructureController : BaseJellyfinApiController [HttpDelete] [ProducesResponseType(StatusCodes.Status204NoContent)] public async Task<ActionResult> RemoveVirtualFolder( - [FromQuery] string? name, + [FromQuery] string name, [FromQuery] bool refreshLibrary = false) { await _libraryManager.RemoveVirtualFolder(name, refreshLibrary).ConfigureAwait(false); @@ -267,18 +267,16 @@ public class LibraryStructureController : BaseJellyfinApiController /// <param name="refreshLibrary">Whether to refresh the library.</param> /// <returns>A <see cref="NoContentResult"/>.</returns> /// <response code="204">Media path removed.</response> - /// <exception cref="ArgumentNullException">The name of the library may not be empty.</exception> + /// <exception cref="ArgumentException">The name of the library and path may not be empty.</exception> [HttpDelete("Paths")] [ProducesResponseType(StatusCodes.Status204NoContent)] public ActionResult RemoveMediaPath( - [FromQuery] string? name, - [FromQuery] string? path, + [FromQuery] string name, + [FromQuery] string path, [FromQuery] bool refreshLibrary = false) { - if (string.IsNullOrWhiteSpace(name)) - { - throw new ArgumentNullException(nameof(name)); - } + ArgumentException.ThrowIfNullOrWhiteSpace(name); + ArgumentException.ThrowIfNullOrWhiteSpace(path); _libraryMonitor.Stop(); |
