From 6b278f9b041045baa0d6edcfe6cb44819b18bf0d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 17 Mar 2015 22:39:55 -0400 Subject: [PATCH] stub out localizable plugin --- .../MediaBrowser.Controller.csproj | 1 + .../Plugins/ILocalizablePlugin.cs | 20 +++++++++++++++++++ .../Library/LibraryManager.cs | 2 +- .../Photos/DynamicImageHelpers.cs | 10 ++++++++++ .../UserViews/DynamicImageProvider.cs | 4 +++- 5 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 MediaBrowser.Controller/Plugins/ILocalizablePlugin.cs diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 5b8c8d414..e4a31c82d 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -249,6 +249,7 @@ + diff --git a/MediaBrowser.Controller/Plugins/ILocalizablePlugin.cs b/MediaBrowser.Controller/Plugins/ILocalizablePlugin.cs new file mode 100644 index 000000000..d294107d7 --- /dev/null +++ b/MediaBrowser.Controller/Plugins/ILocalizablePlugin.cs @@ -0,0 +1,20 @@ +using System.IO; +using System.Reflection; + +namespace MediaBrowser.Controller.Plugins +{ + public interface ILocalizablePlugin + { + Stream GetDictionary(string culture); + } + + public static class LocalizablePluginHelper + { + public static Stream GetDictionary(Assembly assembly, string manifestPrefix, string culture) + { + // Find all dictionaries using GetManifestResourceNames, start start with the prefix + // Return the one for the culture if exists, otherwise return the default + return null; + } + } +} diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index 43c985f33..0fda026fd 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -1673,7 +1673,7 @@ namespace MediaBrowser.Server.Implementations.Library throw new ArgumentNullException("viewType"); } - var id = GetNewItemId("35_namedview_" + name + user.Id.ToString("N") + (parentId ?? string.Empty), typeof(UserView)); + var id = GetNewItemId("36_namedview_" + name + user.Id.ToString("N") + (parentId ?? string.Empty), typeof(UserView)); var path = Path.Combine(ConfigurationManager.ApplicationPaths.InternalMetadataPath, "views", id.ToString("N")); diff --git a/MediaBrowser.Server.Implementations/Photos/DynamicImageHelpers.cs b/MediaBrowser.Server.Implementations/Photos/DynamicImageHelpers.cs index fce8c9b6b..7f8435097 100644 --- a/MediaBrowser.Server.Implementations/Photos/DynamicImageHelpers.cs +++ b/MediaBrowser.Server.Implementations/Photos/DynamicImageHelpers.cs @@ -21,6 +21,11 @@ namespace MediaBrowser.Server.Implementations.Photos throw new ArgumentException("Empty file found in files list"); } + if (files.Count == 0) + { + return null; + } + if (files.Count < 3) { return await GetSingleImage(files, fileSystem).ConfigureAwait(false); @@ -68,6 +73,11 @@ namespace MediaBrowser.Server.Implementations.Photos throw new ArgumentException("Empty file found in files list"); } + if (files.Count == 0) + { + return null; + } + if (files.Count < 4) { return await GetSingleImage(files, fileSystem).ConfigureAwait(false); diff --git a/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs b/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs index e213327ea..2af4c6a8c 100644 --- a/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs +++ b/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs @@ -229,7 +229,9 @@ namespace MediaBrowser.Server.Implementations.UserViews CollectionType.Channels, CollectionType.LiveTv, CollectionType.Books, - CollectionType.Photos + CollectionType.Photos, + CollectionType.HomeVideos, + string.Empty }; return collectionStripViewTypes.Contains(view.ViewType ?? string.Empty);