2015-05-10 06:06:12 -07:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
2014-10-29 15:01:02 -07:00
|
|
|
|
using MediaBrowser.Controller.Providers;
|
2015-05-10 06:06:12 -07:00
|
|
|
|
using MediaBrowser.Model.Entities;
|
2014-08-11 19:59:51 -07:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2015-05-10 06:06:12 -07:00
|
|
|
|
using System.Threading;
|
2014-08-11 19:59:51 -07:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2014-10-19 20:04:45 -07:00
|
|
|
|
namespace MediaBrowser.Server.Implementations.Photos
|
2014-08-11 19:59:51 -07:00
|
|
|
|
{
|
2015-05-10 06:06:12 -07:00
|
|
|
|
//public class PhotoAlbumImageProvider : IDynamicImageProvider
|
2015-05-02 16:08:02 -07:00
|
|
|
|
//{
|
2015-05-10 06:06:12 -07:00
|
|
|
|
// public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
2015-05-02 16:08:02 -07:00
|
|
|
|
// {
|
2015-05-10 06:06:12 -07:00
|
|
|
|
// return new List<ImageType> { ImageType.Primary };
|
2015-05-02 16:08:02 -07:00
|
|
|
|
// }
|
2014-10-19 20:04:45 -07:00
|
|
|
|
|
2015-05-10 06:06:12 -07:00
|
|
|
|
// public Task<DynamicImageResponse> GetImage(IHasImages item, ImageType type, CancellationToken cancellationToken)
|
2015-05-02 16:08:02 -07:00
|
|
|
|
// {
|
2015-05-10 06:06:12 -07:00
|
|
|
|
// var album = (PhotoAlbum)item;
|
2014-10-19 20:04:45 -07:00
|
|
|
|
|
2015-05-10 06:06:12 -07:00
|
|
|
|
// 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)
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// public string Name
|
|
|
|
|
// {
|
|
|
|
|
// get { return "Image Extractor"; }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// public bool Supports(IHasImages item)
|
|
|
|
|
// {
|
|
|
|
|
// return item is PhotoAlbum;
|
2015-05-02 16:08:02 -07:00
|
|
|
|
// }
|
|
|
|
|
//}
|
2014-08-11 19:59:51 -07:00
|
|
|
|
}
|