|
|
@ -135,7 +135,11 @@ namespace MediaBrowser.Controller.Entities.TV
|
|
|
|
[IgnoreDataMember]
|
|
|
|
[IgnoreDataMember]
|
|
|
|
public Series Series
|
|
|
|
public Series Series
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return FindParent<Series>(); }
|
|
|
|
get
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var seriesId = SeriesId ?? FindSeriesId();
|
|
|
|
|
|
|
|
return seriesId.HasValue ? (LibraryManager.GetItemById(seriesId.Value) as Series) : null;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[IgnoreDataMember]
|
|
|
|
[IgnoreDataMember]
|
|
|
@ -143,24 +147,8 @@ namespace MediaBrowser.Controller.Entities.TV
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get
|
|
|
|
get
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var season = FindParent<Season>();
|
|
|
|
var seasonId = SeasonId ?? FindSeasonId();
|
|
|
|
|
|
|
|
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 +181,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 +267,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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|