mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-15 21:43:03 +03:00
Apply suggestions from code review
This commit is contained in:
committed by
Cody Robibero
parent
9e23af5636
commit
9e0958d822
@@ -1803,15 +1803,14 @@ namespace Jellyfin.Api.Controllers
|
||||
{
|
||||
await using var memoryStream = await GetMemoryStream(Request.Body).ConfigureAwait(false);
|
||||
|
||||
// Handle image/png; charset=utf-8
|
||||
var mimeType = Request.ContentType.Split(';').FirstOrDefault();
|
||||
var mimeType = MediaTypeHeaderValue.Parse(Request.ContentType).MediaType;
|
||||
|
||||
if (mimeType == null)
|
||||
if (!mimeType.HasValue)
|
||||
{
|
||||
return BadRequest("Error reading mimetype from uploaded image");
|
||||
}
|
||||
|
||||
var filePath = Path.Combine(_appPaths.DataPath, "splashscreen-upload" + MimeTypes.ToExtension(mimeType));
|
||||
var filePath = Path.Combine(_appPaths.DataPath, "splashscreen-upload" + MimeTypes.ToExtension(mimeType.Value));
|
||||
var brandingOptions = _serverConfigurationManager.GetConfiguration<BrandingOptions>("branding");
|
||||
brandingOptions.SplashscreenLocation = filePath;
|
||||
_serverConfigurationManager.SaveConfiguration("branding", brandingOptions);
|
||||
|
||||
Reference in New Issue
Block a user