Browse Source

stub out localizable plugin

Luke Pulverenti 10 years ago
parent
commit
6b278f9b04

+ 1 - 0
MediaBrowser.Controller/MediaBrowser.Controller.csproj

@@ -249,6 +249,7 @@
     <Compile Include="Persistence\MediaStreamQuery.cs" />
     <Compile Include="Playlists\IPlaylistManager.cs" />
     <Compile Include="Playlists\Playlist.cs" />
+    <Compile Include="Plugins\ILocalizablePlugin.cs" />
     <Compile Include="Providers\AlbumInfo.cs" />
     <Compile Include="Providers\ArtistInfo.cs" />
     <Compile Include="Providers\BookInfo.cs" />

+ 20 - 0
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;
+        } 
+    }
+}

+ 1 - 1
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"));
 

+ 10 - 0
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);

+ 3 - 1
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);