add image provider for artists
This commit is contained in:
parent
8d7e9ab515
commit
aa66444264
|
@ -215,7 +215,7 @@ namespace Emby.Server.Implementations.Images
|
|||
|
||||
if (imageType == ImageType.Primary)
|
||||
{
|
||||
if (item is UserView || item is Playlist || item is MusicGenre || item is Genre || item is PhotoAlbum)
|
||||
if (item is UserView || item is Playlist || item is MusicGenre || item is Genre || item is PhotoAlbum || item is MusicArtist)
|
||||
{
|
||||
return CreateSquareCollage(item, itemsWithImages, outputPath);
|
||||
}
|
||||
|
|
|
@ -67,6 +67,30 @@ namespace Emby.Server.Implementations.Playlists
|
|||
}
|
||||
}
|
||||
|
||||
public class MusicArtistImageProvider : BaseDynamicImageProvider<MusicArtist>
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
||||
public MusicArtistImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor, ILibraryManager libraryManager) : base(fileSystem, providerManager, applicationPaths, imageProcessor)
|
||||
{
|
||||
_libraryManager = libraryManager;
|
||||
}
|
||||
|
||||
protected override IReadOnlyList<BaseItem> GetItemsWithImages(BaseItem item)
|
||||
{
|
||||
return _libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
ArtistIds = new[] { item.Id },
|
||||
IncludeItemTypes = new[] { typeof(MusicAlbum).Name },
|
||||
OrderBy = new[] { (ItemSortBy.Random, SortOrder.Ascending) },
|
||||
Limit = 4,
|
||||
Recursive = true,
|
||||
ImageTypes = new[] { ImageType.Primary },
|
||||
DtoOptions = new DtoOptions(false)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class MusicGenreImageProvider : BaseDynamicImageProvider<MusicGenre>
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
|
Loading…
Reference in New Issue
Block a user