The Free Software Media System - Server Backend & API
Convert from base64 when saving item images
cvium5b4eef741a0a
diff --git a/Jellyfin.Api/Controllers/ImageController.cs b/Jellyfin.Api/Controllers/ImageController.csindex e828a0801b..c606d327c5 100644--- a/Jellyfin.Api/Controllers/ImageController.cs+++ b/Jellyfin.Api/Controllers/ImageController.cs@@ -325,9 +325,11 @@ namespace Jellyfin.Api.Controllersreturn NotFound();}+ await using var memoryStream = await GetMemoryStream(Request.Body).ConfigureAwait(false);+// Handle image/png; charset=utf-8var mimeType = Request.ContentType.Split(';').FirstOrDefault();- await _providerManager.SaveImage(item, Request.Body, mimeType, imageType, null, CancellationToken.None).ConfigureAwait(false);+ await _providerManager.SaveImage(item, memoryStream, mimeType, imageType, null, CancellationToken.None).ConfigureAwait(false);await item.UpdateToRepositoryAsync(ItemUpdateType.ImageUpdate, CancellationToken.None).ConfigureAwait(false);return NoContent();@@ -358,9 +360,11 @@ namespace Jellyfin.Api.Controllersreturn NotFound();}+ await using var memoryStream = await GetMemoryStream(Request.Body).ConfigureAwait(false);+// Handle image/png; charset=utf-8var mimeType = Request.ContentType.Split(';').FirstOrDefault();- await _providerManager.SaveImage(item, Request.Body, mimeType, imageType, null, CancellationToken.None).ConfigureAwait(false);+ await _providerManager.SaveImage(item, memoryStream, mimeType, imageType, null, CancellationToken.None).ConfigureAwait(false);await item.UpdateToRepositoryAsync(ItemUpdateType.ImageUpdate, CancellationToken.None).ConfigureAwait(false);return NoContent();