Luke Pulverenti 9 anni fa
parent
commit
31e98681fa

+ 12 - 6
MediaBrowser.Controller/Entities/BaseItem.cs

@@ -494,7 +494,18 @@ namespace MediaBrowser.Controller.Entities
         {
         {
             get
             get
             {
             {
-                return _sortName ?? (_sortName = CreateSortName());
+                if (_sortName == null)
+                {
+                    if (!string.IsNullOrWhiteSpace(ForcedSortName))
+                    {
+                        _sortName = ModifySortChunks(ForcedSortName);
+                    }
+                    else
+                    {
+                        _sortName = CreateSortName();
+                    }
+                }
+                return _sortName;
             }
             }
             set
             set
             {
             {
@@ -529,11 +540,6 @@ namespace MediaBrowser.Controller.Entities
         /// <returns>System.String.</returns>
         /// <returns>System.String.</returns>
         protected virtual string CreateSortName()
         protected virtual string CreateSortName()
         {
         {
-            if (!string.IsNullOrWhiteSpace(ForcedSortName))
-            {
-                return ModifySortChunks(ForcedSortName).ToLower();
-            }
-
             if (Name == null) return null; //some items may not have name filled in properly
             if (Name == null) return null; //some items may not have name filled in properly
 
 
             if (!EnableAlphaNumericSorting)
             if (!EnableAlphaNumericSorting)

+ 1 - 1
MediaBrowser.Controller/Entities/TV/Episode.cs

@@ -175,7 +175,7 @@ namespace MediaBrowser.Controller.Entities.TV
         /// <returns>System.String.</returns>
         /// <returns>System.String.</returns>
         protected override string CreateSortName()
         protected override string CreateSortName()
         {
         {
-            return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("000-") : "")
+            return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("000 - ") : "")
                     + (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;
                     + (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;
         }
         }
 
 

+ 1 - 1
MediaBrowser.Server.Implementations/Persistence/CleanDatabaseScheduledTask.cs

@@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
         private readonly ILocalizationManager _localization;
         private readonly ILocalizationManager _localization;
         private readonly ITaskManager _taskManager;
         private readonly ITaskManager _taskManager;
 
 
-        public const int MigrationVersion = 20;
+        public const int MigrationVersion = 22;
         public static bool EnableUnavailableMessage = false;
         public static bool EnableUnavailableMessage = false;
 
 
         public CleanDatabaseScheduledTask(ILibraryManager libraryManager, IItemRepository itemRepo, ILogger logger, IServerConfigurationManager config, IFileSystem fileSystem, IHttpServer httpServer, ILocalizationManager localization, ITaskManager taskManager)
         public CleanDatabaseScheduledTask(ILibraryManager libraryManager, IItemRepository itemRepo, ILogger logger, IServerConfigurationManager config, IFileSystem fileSystem, IHttpServer httpServer, ILocalizationManager localization, ITaskManager taskManager)

+ 1 - 1
MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs

@@ -79,7 +79,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
 
 
         private IDbCommand _updateInheritedRatingCommand;
         private IDbCommand _updateInheritedRatingCommand;
 
 
-        private const int LatestSchemaVersion = 56;
+        private const int LatestSchemaVersion = 57;
 
 
         /// <summary>
         /// <summary>
         /// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
         /// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.