|
|
|
@ -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,31 +384,34 @@ namespace MediaBrowser.Controller.Entities.TV
|
|
|
|
|
IncludeItemTypes = new[] { typeof(Episode).Name },
|
|
|
|
|
SortBy = new[] { ItemSortBy.SortName }
|
|
|
|
|
};
|
|
|
|
|
var config = user.Configuration;
|
|
|
|
|
if (!config.DisplayMissingEpisodes && !config.DisplayUnairedEpisodes)
|
|
|
|
|
{
|
|
|
|
|
query.IsVirtualItem = false;
|
|
|
|
|
}
|
|
|
|
|
else if (!config.DisplayMissingEpisodes)
|
|
|
|
|
{
|
|
|
|
|
query.IsMissing = false;
|
|
|
|
|
}
|
|
|
|
|
else if (!config.DisplayUnairedEpisodes)
|
|
|
|
|
if (user != null)
|
|
|
|
|
{
|
|
|
|
|
query.IsVirtualUnaired = false;
|
|
|
|
|
var config = user.Configuration;
|
|
|
|
|
if (!config.DisplayMissingEpisodes && !config.DisplayUnairedEpisodes)
|
|
|
|
|
{
|
|
|
|
|
query.IsVirtualItem = false;
|
|
|
|
|
}
|
|
|
|
|
else if (!config.DisplayMissingEpisodes)
|
|
|
|
|
{
|
|
|
|
|
query.IsMissing = false;
|
|
|
|
|
}
|
|
|
|
|
else if (!config.DisplayUnairedEpisodes)
|
|
|
|
|
{
|
|
|
|
|
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");
|
|
|
|
|