|
|
|
@ -14,17 +14,20 @@ using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using CommonIO;
|
|
|
|
|
using MediaBrowser.Controller.LiveTv;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Server.Implementations.UserViews
|
|
|
|
|
{
|
|
|
|
|
public class DynamicImageProvider : BaseDynamicImageProvider<UserView>
|
|
|
|
|
{
|
|
|
|
|
private readonly IUserManager _userManager;
|
|
|
|
|
private readonly ILibraryManager _libraryManager;
|
|
|
|
|
|
|
|
|
|
public DynamicImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor, IUserManager userManager)
|
|
|
|
|
public DynamicImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor, IUserManager userManager, ILibraryManager libraryManager)
|
|
|
|
|
: base(fileSystem, providerManager, applicationPaths, imageProcessor)
|
|
|
|
|
{
|
|
|
|
|
_userManager = userManager;
|
|
|
|
|
_libraryManager = libraryManager;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
|
|
|
@ -50,7 +53,15 @@ namespace MediaBrowser.Server.Implementations.UserViews
|
|
|
|
|
|
|
|
|
|
if (string.Equals(view.ViewType, CollectionType.LiveTv, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return new List<BaseItem>();
|
|
|
|
|
var programs = _libraryManager.GetItemList(new InternalItemsQuery
|
|
|
|
|
{
|
|
|
|
|
IncludeItemTypes = new[] { typeof(LiveTvProgram).Name },
|
|
|
|
|
ImageTypes = new[] { ImageType.Primary },
|
|
|
|
|
Limit = 30,
|
|
|
|
|
IsMovie = true
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
return GetFinalItems(programs).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (string.Equals(view.ViewType, SpecialFolder.MovieGenre, StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
@ -147,6 +158,7 @@ namespace MediaBrowser.Server.Implementations.UserViews
|
|
|
|
|
CollectionType.MusicVideos,
|
|
|
|
|
CollectionType.HomeVideos,
|
|
|
|
|
CollectionType.BoxSets,
|
|
|
|
|
CollectionType.LiveTv,
|
|
|
|
|
CollectionType.Playlists,
|
|
|
|
|
CollectionType.Photos,
|
|
|
|
|
string.Empty
|
|
|
|
|