Merge pull request #6257 from MrTimscampi/music-library-backdrop
Use artist backdrop for generated library image
This commit is contained in:
commit
b8eb8940c7
|
@ -112,7 +112,7 @@ namespace Jellyfin.Drawing.Skia
|
||||||
canvas.DrawImage(residedBackdrop, 0, 0);
|
canvas.DrawImage(residedBackdrop, 0, 0);
|
||||||
|
|
||||||
// draw shadow rectangle
|
// draw shadow rectangle
|
||||||
var paintColor = new SKPaint
|
using var paintColor = new SKPaint
|
||||||
{
|
{
|
||||||
Color = SKColors.Black.WithAlpha(0x78),
|
Color = SKColors.Black.WithAlpha(0x78),
|
||||||
Style = SKPaintStyle.Fill
|
Style = SKPaintStyle.Fill
|
||||||
|
@ -130,7 +130,7 @@ namespace Jellyfin.Drawing.Skia
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw library name
|
// draw library name
|
||||||
var textPaint = new SKPaint
|
using var textPaint = new SKPaint
|
||||||
{
|
{
|
||||||
Color = SKColors.White,
|
Color = SKColors.White,
|
||||||
Style = SKPaintStyle.Fill,
|
Style = SKPaintStyle.Fill,
|
||||||
|
|
|
@ -19,6 +19,7 @@ using MediaBrowser.Common.Extensions;
|
||||||
using MediaBrowser.Controller.Channels;
|
using MediaBrowser.Controller.Channels;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
using MediaBrowser.Controller.Dto;
|
using MediaBrowser.Controller.Dto;
|
||||||
|
using MediaBrowser.Controller.Entities.Audio;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.Persistence;
|
using MediaBrowser.Controller.Persistence;
|
||||||
using MediaBrowser.Controller.Providers;
|
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)
|
return GetImages(imageType)
|
||||||
.ElementAtOrDefault(imageIndex);
|
.ElementAtOrDefault(imageIndex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user