update sortname generation

pull/1154/head
Luke Pulverenti 8 years ago
parent 8da3a3680c
commit 3c82d8540b

@ -131,7 +131,7 @@ namespace MediaBrowser.Controller.Entities.Audio
/// Creates the name of the sort.
/// </summary>
/// <returns>System.String.</returns>
protected override string CreateSortName()
protected override string CreateSortNameInternal()
{
return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("0000 - ") : "")
+ (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;

@ -689,14 +689,22 @@ namespace MediaBrowser.Controller.Entities
return System.IO.Path.Combine(basePath, idString.Substring(0, 2), idString);
}
protected string CreateSortName()
{
if (string.IsNullOrWhiteSpace(Name))
{
return null;
}
return CreateSortNameInternal();
}
/// <summary>
/// Creates the name of the sort.
/// </summary>
/// <returns>System.String.</returns>
protected virtual string CreateSortName()
protected virtual string CreateSortNameInternal()
{
if (Name == null) return null; //some items may not have name filled in properly
if (!EnableAlphaNumericSorting)
{
return Name.TrimStart();

@ -237,7 +237,7 @@ namespace MediaBrowser.Controller.Entities.TV
/// Creates the name of the sort.
/// </summary>
/// <returns>System.String.</returns>
protected override string CreateSortName()
protected override string CreateSortNameInternal()
{
return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("000 - ") : "")
+ (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;

@ -145,7 +145,7 @@ namespace MediaBrowser.Controller.Entities.TV
/// Creates the name of the sort.
/// </summary>
/// <returns>System.String.</returns>
protected override string CreateSortName()
protected override string CreateSortNameInternal()
{
return IndexNumber != null ? IndexNumber.Value.ToString("0000") : Name;
}

@ -89,7 +89,7 @@ namespace MediaBrowser.Controller.LiveTv
}
}
protected override string CreateSortName()
protected override string CreateSortNameInternal()
{
if (!string.IsNullOrEmpty(Number))
{

Loading…
Cancel
Save