From 73b294b4cea8a242910124e493e317ab0fae5e92 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 23 Oct 2013 12:51:51 -0400 Subject: fixes #595 - Linux/Unix file quantity limitation for ImagesByName/People folder --- .../Library/LibraryManager.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Server.Implementations/Library/LibraryManager.cs') diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index b632792f6..59ae9b734 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -703,7 +703,21 @@ namespace MediaBrowser.Server.Implementations.Library var validFilename = FileSystem.GetValidFilename(name); - var key = Path.Combine(path, validFilename); + string subFolderPrefix = null; + + if (typeof(T) == typeof(Person) && ConfigurationManager.Configuration.EnablePeoplePrefixSubFolders) + { + subFolderPrefix = validFilename.Substring(0, 1); + + if (string.IsNullOrWhiteSpace(subFolderPrefix)) + { + subFolderPrefix = "0"; + } + } + + var key = string.IsNullOrEmpty(subFolderPrefix) ? + Path.Combine(path, validFilename) : + Path.Combine(path, subFolderPrefix, validFilename); BaseItem obj; -- cgit v1.2.3