fix slow episode responses
This commit is contained in:
parent
29d0b21a78
commit
916bda6f32
|
@ -135,7 +135,10 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public Series Series
|
public Series Series
|
||||||
{
|
{
|
||||||
get { return FindParent<Series>(); }
|
get
|
||||||
|
{
|
||||||
|
return SeriesId.HasValue ? (LibraryManager.GetItemById(SeriesId.Value) as Series) : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
|
@ -143,24 +146,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var season = FindParent<Season>();
|
return SeasonId.HasValue ? (LibraryManager.GetItemById(SeasonId.Value) as Season) : null;
|
||||||
|
|
||||||
// Episodes directly in series folder
|
|
||||||
if (season == null)
|
|
||||||
{
|
|
||||||
var series = Series;
|
|
||||||
|
|
||||||
if (series != null && ParentIndexNumber.HasValue)
|
|
||||||
{
|
|
||||||
var findNumber = ParentIndexNumber.Value;
|
|
||||||
|
|
||||||
season = series.Children
|
|
||||||
.OfType<Season>()
|
|
||||||
.FirstOrDefault(i => i.IndexNumber.HasValue && i.IndexNumber.Value == findNumber);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return season;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +179,23 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
|
|
||||||
public Guid? FindSeasonId()
|
public Guid? FindSeasonId()
|
||||||
{
|
{
|
||||||
var season = Season;
|
var season = FindParent<Season>();
|
||||||
|
|
||||||
|
// Episodes directly in series folder
|
||||||
|
if (season == null)
|
||||||
|
{
|
||||||
|
var series = Series;
|
||||||
|
|
||||||
|
if (series != null && ParentIndexNumber.HasValue)
|
||||||
|
{
|
||||||
|
var findNumber = ParentIndexNumber.Value;
|
||||||
|
|
||||||
|
season = series.Children
|
||||||
|
.OfType<Season>()
|
||||||
|
.FirstOrDefault(i => i.IndexNumber.HasValue && i.IndexNumber.Value == findNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return season == null ? (Guid?)null : season.Id;
|
return season == null ? (Guid?)null : season.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,7 +265,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
|
|
||||||
public Guid? FindSeriesId()
|
public Guid? FindSeriesId()
|
||||||
{
|
{
|
||||||
var series = Series;
|
var series = FindParent<Series>();
|
||||||
return series == null ? (Guid?)null : series.Id;
|
return series == null ? (Guid?)null : series.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,10 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public Series Series
|
public Series Series
|
||||||
{
|
{
|
||||||
get { return FindParent<Series>(); }
|
get
|
||||||
|
{
|
||||||
|
return SeriesId.HasValue ? (LibraryManager.GetItemById(SeriesId.Value) as Series) : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
|
@ -241,7 +244,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
|
|
||||||
public Guid? FindSeriesId()
|
public Guid? FindSeriesId()
|
||||||
{
|
{
|
||||||
var series = Series;
|
var series = FindParent<Series>();
|
||||||
return series == null ? (Guid?)null : series.Id;
|
return series == null ? (Guid?)null : series.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user