aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/LibraryStructureController.cs
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2021-03-14 10:19:35 -0400
committerPatrick Barron <barronpm@gmail.com>2021-03-14 10:19:35 -0400
commite5380c653b0584a3b5d61da1a9b005d6155694cb (patch)
tree328459396c783e8c61214c8d960d8ba07b5773f6 /Jellyfin.Api/Controllers/LibraryStructureController.cs
parent7c413a323b0d22a59532687b854ea228d544ecb7 (diff)
parent109f24514fac52c8f138c4913d7ef614ff1973a1 (diff)
Merge branch 'master' into ef-cleanup
# Conflicts: # Jellyfin.Data/Entities/Libraries/MediaFileStream.cs # Jellyfin.Data/Jellyfin.Data.csproj
Diffstat (limited to 'Jellyfin.Api/Controllers/LibraryStructureController.cs')
-rw-r--r--Jellyfin.Api/Controllers/LibraryStructureController.cs13
1 files changed, 5 insertions, 8 deletions
diff --git a/Jellyfin.Api/Controllers/LibraryStructureController.cs b/Jellyfin.Api/Controllers/LibraryStructureController.cs
index 328efea26..be9127dd3 100644
--- a/Jellyfin.Api/Controllers/LibraryStructureController.cs
+++ b/Jellyfin.Api/Controllers/LibraryStructureController.cs
@@ -241,23 +241,20 @@ namespace Jellyfin.Api.Controllers
/// <summary>
/// Updates a media path.
/// </summary>
- /// <param name="name">The name of the library.</param>
- /// <param name="pathInfo">The path info.</param>
+ /// <param name="mediaPathRequestDto">The name of the library and path infos.</param>
/// <returns>A <see cref="NoContentResult"/>.</returns>
/// <response code="204">Media path updated.</response>
/// <exception cref="ArgumentNullException">The name of the library may not be empty.</exception>
[HttpPost("Paths/Update")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
- public ActionResult UpdateMediaPath(
- [FromQuery] string? name,
- [FromBody] MediaPathInfo? pathInfo)
+ public ActionResult UpdateMediaPath([FromBody, Required] UpdateMediaPathRequestDto mediaPathRequestDto)
{
- if (string.IsNullOrWhiteSpace(name))
+ if (string.IsNullOrWhiteSpace(mediaPathRequestDto.Name))
{
- throw new ArgumentNullException(nameof(name));
+ throw new ArgumentNullException(nameof(mediaPathRequestDto), "Name must not be null or empty");
}
- _libraryManager.UpdateMediaPath(name, pathInfo);
+ _libraryManager.UpdateMediaPath(mediaPathRequestDto.Name, mediaPathRequestDto.PathInfo);
return NoContent();
}