diff options
| author | David Ullmer <davidullmer@outlook.de> | 2021-08-17 19:18:24 +0200 |
|---|---|---|
| committer | Cody Robibero <cody@robibe.ro> | 2022-01-04 08:20:16 -0700 |
| commit | c70452b4a4046b82e26a2e73b1d67e8f82fe0e32 (patch) | |
| tree | b4e132609278fcad559384f291e0b236c2012193 | |
| parent | 045ef4b72602d682e31eac891c438941ffe16e42 (diff) | |
Add missing response code documentation
| -rw-r--r-- | Jellyfin.Api/Controllers/ImageController.cs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Jellyfin.Api/Controllers/ImageController.cs b/Jellyfin.Api/Controllers/ImageController.cs index d7aac9b9c..3b2fc98e7 100644 --- a/Jellyfin.Api/Controllers/ImageController.cs +++ b/Jellyfin.Api/Controllers/ImageController.cs @@ -1764,9 +1764,7 @@ namespace Jellyfin.Api.Controllers { Image = new ItemImageInfo { - Path = splashscreenPath, - Height = 1080, - Width = 1920 + Path = splashscreenPath }, Height = height, MaxHeight = maxHeight, @@ -1791,11 +1789,15 @@ namespace Jellyfin.Api.Controllers /// Uploads a custom splashscreen. /// </summary> /// <returns>A <see cref="NoContentResult"/> indicating success.</returns> + /// <response code="204">Sucessfully uploaded new splashscreen.</response> + /// <response code="400">Error reading MimeType from uploaded image.</response> + /// <response code="403">User does not have permission to upload splashscreen..</response> /// <exception cref="ArgumentException">Error reading the image format.</exception> [HttpPost("Branding/Splashscreen")] [Authorize(Policy = Policies.RequiresElevation)] [ProducesResponseType(StatusCodes.Status204NoContent)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status403Forbidden)] [AcceptsImageFile] public async Task<ActionResult> UploadCustomSplashscreen() { @@ -1806,7 +1808,7 @@ namespace Jellyfin.Api.Controllers if (mimeType == null) { - throw new ArgumentException("Error reading mimetype from uploaded image!"); + return BadRequest("Error reading mimetype from uploaded image"); } var filePath = Path.Combine(_appPaths.DataPath, "splashscreen-upload" + MimeTypes.ToExtension(mimeType)); |
