Merge pull request #6257 from MrTimscampi/music-library-backdrop

Use artist backdrop for generated library image
pull/5092/head^2
dkanada 3 years ago committed by GitHub
commit b8eb8940c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -112,7 +112,7 @@ namespace Jellyfin.Drawing.Skia
canvas.DrawImage(residedBackdrop, 0, 0);
// draw shadow rectangle
var paintColor = new SKPaint
using var paintColor = new SKPaint
{
Color = SKColors.Black.WithAlpha(0x78),
Style = SKPaintStyle.Fill
@ -130,7 +130,7 @@ namespace Jellyfin.Drawing.Skia
}
// draw library name
var textPaint = new SKPaint
using var textPaint = new SKPaint
{
Color = SKColors.White,
Style = SKPaintStyle.Fill,

@ -19,6 +19,7 @@ using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Providers;
@ -2439,6 +2440,17 @@ namespace MediaBrowser.Controller.Entities
};
}
// Music albums usually don't have dedicated backdrops, so return one from the artist instead
if (GetType() == typeof(MusicAlbum) && imageType == ImageType.Backdrop)
{
var artist = FindParent<MusicArtist>();
if (artist != null)
{
return artist.GetImages(imageType).ElementAtOrDefault(imageIndex);
}
}
return GetImages(imageType)
.ElementAtOrDefault(imageIndex);
}

Loading…
Cancel
Save