mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-04 03:27:21 -05:00 
			
		
		
		
	Convert from base64 when saving item images
This commit is contained in:
		
							parent
							
								
									4f6a585424
								
							
						
					
					
						commit
						5b4eef741a
					
				@ -325,9 +325,11 @@ namespace Jellyfin.Api.Controllers
 | 
				
			|||||||
                return NotFound();
 | 
					                return NotFound();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            await using var memoryStream = await GetMemoryStream(Request.Body).ConfigureAwait(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // Handle image/png; charset=utf-8
 | 
					            // Handle image/png; charset=utf-8
 | 
				
			||||||
            var mimeType = Request.ContentType.Split(';').FirstOrDefault();
 | 
					            var 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);
 | 
					            await item.UpdateToRepositoryAsync(ItemUpdateType.ImageUpdate, CancellationToken.None).ConfigureAwait(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return NoContent();
 | 
					            return NoContent();
 | 
				
			||||||
@ -358,9 +360,11 @@ namespace Jellyfin.Api.Controllers
 | 
				
			|||||||
                return NotFound();
 | 
					                return NotFound();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            await using var memoryStream = await GetMemoryStream(Request.Body).ConfigureAwait(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // Handle image/png; charset=utf-8
 | 
					            // Handle image/png; charset=utf-8
 | 
				
			||||||
            var mimeType = Request.ContentType.Split(';').FirstOrDefault();
 | 
					            var 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);
 | 
					            await item.UpdateToRepositoryAsync(ItemUpdateType.ImageUpdate, CancellationToken.None).ConfigureAwait(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return NoContent();
 | 
					            return NoContent();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user