From 3741eb24263de151a57e66dd6770fc82f69fe9c4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 16 Oct 2015 01:36:16 -0400 Subject: [PATCH] add image editing to library setup --- MediaBrowser.Model/Entities/VirtualFolderInfo.cs | 6 ++++++ .../Folders/DefaultImageProvider.cs | 11 +++++++++-- .../Library/LibraryManager.cs | 5 +++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Model/Entities/VirtualFolderInfo.cs b/MediaBrowser.Model/Entities/VirtualFolderInfo.cs index b7f92e9ec..1161ab005 100644 --- a/MediaBrowser.Model/Entities/VirtualFolderInfo.cs +++ b/MediaBrowser.Model/Entities/VirtualFolderInfo.cs @@ -33,6 +33,12 @@ namespace MediaBrowser.Model.Entities Locations = new List(); } + /// + /// Gets or sets the item identifier. + /// + /// The item identifier. + public string ItemId { get; set; } + /// /// Gets or sets the primary image item identifier. /// diff --git a/MediaBrowser.Providers/Folders/DefaultImageProvider.cs b/MediaBrowser.Providers/Folders/DefaultImageProvider.cs index 114346191..270867f90 100644 --- a/MediaBrowser.Providers/Folders/DefaultImageProvider.cs +++ b/MediaBrowser.Providers/Folders/DefaultImageProvider.cs @@ -142,10 +142,17 @@ namespace MediaBrowser.Providers.Folders if (view != null) { - return true; + return !string.IsNullOrWhiteSpace(GetImageUrl(view.ViewType)); } - return item is ICollectionFolder; + var folder = item as ICollectionFolder; + + if (folder != null) + { + return !string.IsNullOrWhiteSpace(GetImageUrl(folder.CollectionType)); + } + + return false; } public Task GetImageResponse(string url, CancellationToken cancellationToken) diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index eff05ba73..0156a46a9 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -1198,6 +1198,11 @@ namespace MediaBrowser.Server.Implementations.Library info.PrimaryImageItemId = libraryFolder.Id.ToString("N"); } + if (libraryFolder != null) + { + info.ItemId = libraryFolder.Id.ToString("N"); + } + return info; }