add faster access to series sort name

This commit is contained in:
Luke Pulverenti
2016-07-10 11:44:53 -04:00
parent efebac4d6b
commit de635fe22c
12 changed files with 94 additions and 68 deletions

View File

@@ -53,7 +53,16 @@ namespace MediaBrowser.Controller.Entities.TV
/// This is the ending episode number for double episodes.
/// </summary>
/// <value>The index number.</value>
public int? IndexNumberEnd { get; set; }
public int? IndexNumberEnd { get; set; }
[IgnoreDataMember]
public string SeriesSortName { get; set; }
public string FindSeriesSortName()
{
var series = Series;
return series == null ? SeriesSortName : series.SortName;
}
[IgnoreDataMember]
protected override bool SupportsOwnedItems

View File

@@ -51,6 +51,15 @@ namespace MediaBrowser.Controller.Entities.TV
}
}
[IgnoreDataMember]
public string SeriesSortName { get; set; }
public string FindSeriesSortName()
{
var series = Series;
return series == null ? SeriesSortName : series.SortName;
}
// Genre, Rating and Stuido will all be the same
protected override IEnumerable<string> GetIndexByOptions()
{

View File

@@ -449,13 +449,8 @@ namespace MediaBrowser.Controller.Entities.TV
return true;
}
if (!episode.ParentIndexNumber.HasValue)
{
var season = episode.Season;
return season != null && string.Equals(GetUniqueSeriesKey(season), seasonPresentationKey, StringComparison.OrdinalIgnoreCase);
}
return false;
var season = episode.Season;
return season != null && string.Equals(GetUniqueSeriesKey(season), seasonPresentationKey, StringComparison.OrdinalIgnoreCase);
});
}