more jquery removal

This commit is contained in:
Luke Pulverenti 2016-06-04 12:10:10 -04:00
parent 020b1d9a64
commit c389dc9473
2 changed files with 13 additions and 14 deletions

View File

@ -238,9 +238,16 @@ namespace MediaBrowser.Controller.Entities.TV
public IEnumerable<Episode> GetEpisodes(User user, bool includeMissing, bool includeVirtualUnaired)
{
var allSeriesEpisodes = GetAllEpisodes(user).ToList();
var allItems = LibraryManager.GetItemList(new InternalItemsQuery(user)
{
AncestorWithPresentationUniqueKey = PresentationUniqueKey,
IncludeItemTypes = new[] { typeof(Episode).Name, typeof(Season).Name },
SortBy = new[] { ItemSortBy.SortName }
}).ToList();
var allEpisodes = GetSeasons(user, true, true)
var allSeriesEpisodes = allItems.OfType<Episode>().ToList();
var allEpisodes = allItems.OfType<Season>()
.SelectMany(i => i.GetEpisodes(this, user, includeMissing, includeVirtualUnaired, allSeriesEpisodes))
.Reverse()
.ToList();

View File

@ -125,7 +125,7 @@ namespace MediaBrowser.Server.Implementations.TV
private Tuple<Episode, DateTime, bool> GetNextUp(Series series, User user)
{
// Get them in display order, then reverse
var allEpisodes = series.GetEpisodes(user, true, true)
var allEpisodes = series.GetEpisodes(user, false, false)
.Where(i => !i.ParentIndexNumber.HasValue || i.ParentIndexNumber.Value != 0)
.Reverse()
.ToList();
@ -134,8 +134,6 @@ namespace MediaBrowser.Server.Implementations.TV
var lastWatchedDate = DateTime.MinValue;
Episode nextUp = null;
var includeMissing = user.Configuration.DisplayMissingEpisodes;
var unplayedEpisodes = new List<Episode>();
// Go back starting with the most recent episodes
@ -157,12 +155,9 @@ namespace MediaBrowser.Server.Implementations.TV
{
unplayedEpisodes.Add(episode);
if (!episode.IsVirtualUnaired && (includeMissing || !episode.IsMissingEpisode))
{
nextUp = episode;
}
}
}
if (lastWatched != null)
{
@ -175,12 +170,9 @@ namespace MediaBrowser.Server.Implementations.TV
{
var unplayedEpisode = unplayedEpisodes[i];
if (!unplayedEpisode.IsVirtualUnaired && (includeMissing || !unplayedEpisode.IsMissingEpisode))
{
firstEpisode = unplayedEpisode;
break;
}
}
// Return the first episode
return new Tuple<Episode, DateTime, bool>(firstEpisode, DateTime.MinValue, true);