@ -373,24 +373,7 @@ namespace MediaBrowser.Controller.Entities.TV
progress . Report ( 100 ) ;
}
private IEnumerable < Episode > GetAllEpisodes ( User user )
{
Logger . Debug ( "Series.GetAllEpisodes entering GetItemList" ) ;
var result = LibraryManager . GetItemList ( new InternalItemsQuery ( user )
{
AncestorWithPresentationUniqueKey = GetUniqueSeriesKey ( this ) ,
IncludeItemTypes = new [ ] { typeof ( Episode ) . Name } ,
SortBy = new [ ] { ItemSortBy . SortName }
} ) . Cast < Episode > ( ) . ToList ( ) ;
Logger . Debug ( "Series.GetAllEpisodes returning {0} episodes" , result . Count ) ;
return result ;
}
public IEnumerable < Episode > GetSeasonEpisodes ( User user , Season parentSeason )
public IEnumerable < Episode > GetSeasonEpisodes ( Season parentSeason , User user )
{
var seriesKey = GetUniqueSeriesKey ( this ) ;
Logger . Debug ( "GetSeasonEpisodes seriesKey: {0}" , seriesKey ) ;
@ -401,6 +384,8 @@ namespace MediaBrowser.Controller.Entities.TV
IncludeItemTypes = new [ ] { typeof ( Episode ) . Name } ,
SortBy = new [ ] { ItemSortBy . SortName }
} ;
if ( user ! = null )
{
var config = user . Configuration ;
if ( ! config . DisplayMissingEpisodes & & ! config . DisplayUnairedEpisodes )
{
@ -414,18 +399,19 @@ namespace MediaBrowser.Controller.Entities.TV
{
query . IsVirtualUnaired = false ;
}
}
var allItems = LibraryManager . GetItemList ( query ) . OfType < Episode > ( ) ;
return GetSeasonEpisodes ( user, parentSeason, allItems ) ;
return GetSeasonEpisodes ( parentSeason, user , allItems ) ;
}
public IEnumerable < Episode > GetSeasonEpisodes ( User user , Season parentSeason , IEnumerable < Episode > allSeriesEpisodes )
public IEnumerable < Episode > GetSeasonEpisodes ( Season parentSeason , User user , IEnumerable < Episode > allSeriesEpisodes )
{
if ( allSeriesEpisodes = = null )
{
Logger . Debug ( "GetSeasonEpisodes allSeriesEpisodes is null" ) ;
return GetSeasonEpisodes ( user, parentSeason) ;
return GetSeasonEpisodes ( parentSeason, user ) ;
}
Logger . Debug ( "GetSeasonEpisodes FilterEpisodesBySeason" ) ;