The Free Software Media System - Server Backend & API
Remove darkening filter from Splashscreen Using the foregroundLayer parameter has the same effect
David Ullmer68db3be0e754
diff --git a/Jellyfin.Api/Controllers/ImageController.cs b/Jellyfin.Api/Controllers/ImageController.csindex 0755b6c44c..d7aac9b9ce 100644--- a/Jellyfin.Api/Controllers/ImageController.cs+++ b/Jellyfin.Api/Controllers/ImageController.cs@@ -1717,7 +1717,6 @@ namespace Jellyfin.Api.Controllers/// <param name="blur">Optional. Blur image.</param>/// <param name="backgroundColor">Optional. Apply a background color for transparent images.</param>/// <param name="foregroundLayer">Optional. Apply a foreground layer on top of the image.</param>- /// <param name="darken">Darken the generated image.</param>/// <response code="200">Splashscreen returned successfully.</response>/// <returns>The splashscreen.</returns>[HttpGet("Branding/Splashscreen")]@@ -1735,8 +1734,7 @@ namespace Jellyfin.Api.Controllers[FromQuery] int? fillHeight,[FromQuery] int? blur,[FromQuery] string? backgroundColor,- [FromQuery] string? foregroundLayer,- [FromQuery] bool? darken = false)+ [FromQuery] string? foregroundLayer){string splashscreenPath;var brandingOptions = _serverConfigurationManager.GetConfiguration<BrandingOptions>("branding");@@ -1746,12 +1744,11 @@ namespace Jellyfin.Api.Controllers}else{- var filename = darken!.Value ? "splashscreen-darken.webp" : "splashscreen.webp";- splashscreenPath = Path.Combine(_appPaths.DataPath, filename);+ splashscreenPath = Path.Combine(_appPaths.DataPath, "splashscreen.webp");if (!System.IO.File.Exists(splashscreenPath) && _imageGenerator.GetSupportedImages().Contains(GeneratedImages.Splashscreen)){- _imageGenerator.GenerateSplashscreen(new SplashscreenOptions(splashscreenPath, darken.Value));+ _imageGenerator.GenerateSplashscreen(splashscreenPath);}}diff --git a/Jellyfin.Drawing.Skia/DefaultImageGenerator.cs b/Jellyfin.Drawing.Skia/DefaultImageGenerator.csindex 780d0b060c..4d029d9069 100644--- a/Jellyfin.Drawing.Skia/DefaultImageGenerator.cs+++ b/Jellyfin.Drawing.Skia/DefaultImageGenerator.cs@@ -44,7 +44,7 @@ namespace Jellyfin.Drawing.Skia}/// <inheritdoc/>- public void GenerateSplashscreen(SplashscreenOptions generationOptions)+ public void GenerateSplashscreen(string outputPath){var posters = GetItemsWithImageType(ImageType.Primary).Select(x => x.GetImages(ImageType.Primary).First().Path).ToList();var landscape = GetItemsWithImageType(ImageType.Thumb).Select(x => x.GetImages(ImageType.Thumb).First().Path).ToList();@@ -57,7 +57,7 @@ namespace Jellyfin.Drawing.Skia}var splashBuilder = new SplashscreenBuilder((SkiaEncoder)_imageEncoder);- splashBuilder.GenerateSplash(posters, landscape, generationOptions.OutputPath, generationOptions.ApplyFilter);+ splashBuilder.GenerateSplash(posters, landscape, outputPath);}private IReadOnlyList<BaseItem> GetItemsWithImageType(ImageType imageType)diff --git a/Jellyfin.Drawing.Skia/SplashscreenBuilder.cs b/Jellyfin.Drawing.Skia/SplashscreenBuilder.csindex 7cb10bfeef..2056515549 100644--- a/Jellyfin.Drawing.Skia/SplashscreenBuilder.cs+++ b/Jellyfin.Drawing.Skia/SplashscreenBuilder.cs@@ -36,10 +36,9 @@ namespace Jellyfin.Drawing.Skia/// <param name="posters">The poster paths.</param>/// <param name="backdrop">The landscape paths.</param>/// <param name="outputPath">The output path.</param>- /// <param name="applyFilter">Whether to apply the darkening filter.</param>- public void GenerateSplash(IReadOnlyList<string> posters, IReadOnlyList<string> backdrop, string outputPath, bool applyFilter)+ public void GenerateSplash(IReadOnlyList<string> posters, IReadOnlyList<string> backdrop, string outputPath){- var wall = GenerateCollage(posters, backdrop, applyFilter);+ var wall = GenerateCollage(posters, backdrop);var transformed = Transform3D(wall);using var outputStream = new SKFileWStream(outputPath);@@ -52,9 +51,8 @@ namespace Jellyfin.Drawing.Skia/// </summary>/// <param name="posters">The poster paths.</param>/// <param name="backdrop">The landscape paths.</param>- /// <param name="applyFilter">Whether to apply the darkening filter.</param>/// <returns>The created collage as a bitmap.</returns>- private SKBitmap GenerateCollage(IReadOnlyList<string> posters, IReadOnlyList<string> backdrop, bool applyFilter)+ private SKBitmap GenerateCollage(IReadOnlyList<string> posters, IReadOnlyList<string> backdrop){_random = new Random();@@ -119,16 +117,6 @@ namespace Jellyfin.Drawing.Skia}}- if (applyFilter)- {- var paintColor = new SKPaint- {- Color = SKColors.Black.WithAlpha(0x50),- Style = SKPaintStyle.Fill- };- canvas.DrawRect(0, 0, WallWidth, WallHeight, paintColor);- }-return bitmap;}diff --git a/MediaBrowser.Controller/Drawing/IImageGenerator.cs b/MediaBrowser.Controller/Drawing/IImageGenerator.csindex 21699c3f0b..4f944ce543 100644--- a/MediaBrowser.Controller/Drawing/IImageGenerator.cs+++ b/MediaBrowser.Controller/Drawing/IImageGenerator.cs@@ -11,7 +11,7 @@ namespace MediaBrowser.Controller.Drawing/// <summary>/// Generates a splashscreen./// </summary>- /// <param name="generationOptions">The options used to generate the splashscreen.</param>- void GenerateSplashscreen(SplashscreenOptions generationOptions);+ /// <param name="outputPath">The path where the splashscreen should be saved.</param>+ void GenerateSplashscreen(string outputPath);}}diff --git a/MediaBrowser.Controller/Drawing/SplashscreenOptions.cs b/MediaBrowser.Controller/Drawing/SplashscreenOptions.csdeleted file mode 100644index ba268b8eb7..0000000000--- a/MediaBrowser.Controller/Drawing/SplashscreenOptions.cs+++ /dev/null@@ -1,29 +0,0 @@-namespace MediaBrowser.Controller.Drawing-{- /// <summary>- /// Options used to generate the splashscreen.- /// </summary>- public class SplashscreenOptions- {- /// <summary>- /// Initializes a new instance of the <see cref="SplashscreenOptions"/> class.- /// </summary>- /// <param name="outputPath">The output path.</param>- /// <param name="applyFilter">Optional. Apply a darkening filter.</param>- public SplashscreenOptions(string outputPath, bool applyFilter = false)- {- OutputPath = outputPath;- ApplyFilter = applyFilter;- }-- /// <summary>- /// Gets or sets the output path.- /// </summary>- public string OutputPath { get; set; }-- /// <summary>- /// Gets or sets a value indicating whether to apply a darkening filter at the end.- /// </summary>- public bool ApplyFilter { get; set; }- }-}