update sort names

This commit is contained in:
Luke Pulverenti 2016-03-31 17:14:03 -04:00
parent fa841e8610
commit 31e98681fa
4 changed files with 15 additions and 9 deletions

View File

@ -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)

View File

@ -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;
} }

View File

@ -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)

View File

@ -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.