mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
update dlna profiles
This commit is contained in:
@@ -8,37 +8,37 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Photos
|
||||
{
|
||||
//public class PhotoAlbumImageProvider : IDynamicImageProvider
|
||||
//{
|
||||
// public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
// {
|
||||
// return new List<ImageType> { ImageType.Primary };
|
||||
// }
|
||||
public class PhotoAlbumImageProvider : IDynamicImageProvider
|
||||
{
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
{
|
||||
return new List<ImageType> { ImageType.Primary };
|
||||
}
|
||||
|
||||
// public Task<DynamicImageResponse> GetImage(IHasImages item, ImageType type, CancellationToken cancellationToken)
|
||||
// {
|
||||
// var album = (PhotoAlbum)item;
|
||||
public Task<DynamicImageResponse> GetImage(IHasImages item, ImageType type, CancellationToken cancellationToken)
|
||||
{
|
||||
var album = (PhotoAlbum)item;
|
||||
|
||||
// var image = album.Children
|
||||
// .OfType<Photo>()
|
||||
// .Select(i => i.GetImagePath(type))
|
||||
// .FirstOrDefault(i => !string.IsNullOrEmpty(i));
|
||||
var image = album.Children
|
||||
.OfType<Photo>()
|
||||
.Select(i => i.GetImagePath(type))
|
||||
.FirstOrDefault(i => !string.IsNullOrEmpty(i));
|
||||
|
||||
// return Task.FromResult(new DynamicImageResponse
|
||||
// {
|
||||
// Path = image,
|
||||
// HasImage = !string.IsNullOrEmpty(image)
|
||||
// });
|
||||
// }
|
||||
return Task.FromResult(new DynamicImageResponse
|
||||
{
|
||||
Path = image,
|
||||
HasImage = !string.IsNullOrEmpty(image)
|
||||
});
|
||||
}
|
||||
|
||||
// public string Name
|
||||
// {
|
||||
// get { return "Image Extractor"; }
|
||||
// }
|
||||
public string Name
|
||||
{
|
||||
get { return "Image Extractor"; }
|
||||
}
|
||||
|
||||
// public bool Supports(IHasImages item)
|
||||
// {
|
||||
// return item is PhotoAlbum;
|
||||
// }
|
||||
//}
|
||||
public bool Supports(IHasImages item)
|
||||
{
|
||||
return item is PhotoAlbum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user