Przeglądaj źródła

update sort names

Luke Pulverenti 9 lat temu
rodzic
commit
31e98681fa

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

@@ -494,7 +494,18 @@ namespace MediaBrowser.Controller.Entities
         {
             get
             {
-                return _sortName ?? (_sortName = CreateSortName());
+                if (_sortName == null)
+                {
+                    if (!string.IsNullOrWhiteSpace(ForcedSortName))
+                    {
+                        _sortName = ModifySortChunks(ForcedSortName);
+                    }
+                    else
+                    {
+                        _sortName = CreateSortName();
+                    }
+                }
+                return _sortName;
             }
             set
             {
@@ -529,11 +540,6 @@ namespace MediaBrowser.Controller.Entities
         /// <returns>System.String.</returns>
         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 (!EnableAlphaNumericSorting)

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

@@ -175,7 +175,7 @@ namespace MediaBrowser.Controller.Entities.TV
         /// <returns>System.String.</returns>
         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;
         }
 

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

@@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
         private readonly ILocalizationManager _localization;
         private readonly ITaskManager _taskManager;
 
-        public const int MigrationVersion = 20;
+        public const int MigrationVersion = 22;
         public static bool EnableUnavailableMessage = false;
 
         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 const int LatestSchemaVersion = 56;
+        private const int LatestSchemaVersion = 57;
 
         /// <summary>
         /// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.