more jquery removal

pull/702/head
Luke Pulverenti 9 years ago
parent 020b1d9a64
commit c389dc9473

@ -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 allSeriesEpisodes = allItems.OfType<Episode>().ToList();
var allEpisodes = GetSeasons(user, true, true)
var allEpisodes = allItems.OfType<Season>()
.SelectMany(i => i.GetEpisodes(this, user, includeMissing, includeVirtualUnaired, allSeriesEpisodes))
.Reverse()
.ToList();

@ -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,10 +155,7 @@ namespace MediaBrowser.Server.Implementations.TV
{
unplayedEpisodes.Add(episode);
if (!episode.IsVirtualUnaired && (includeMissing || !episode.IsMissingEpisode))
{
nextUp = episode;
}
nextUp = episode;
}
}
@ -175,11 +170,8 @@ namespace MediaBrowser.Server.Implementations.TV
{
var unplayedEpisode = unplayedEpisodes[i];
if (!unplayedEpisode.IsVirtualUnaired && (includeMissing || !unplayedEpisode.IsMissingEpisode))
{
firstEpisode = unplayedEpisode;
break;
}
firstEpisode = unplayedEpisode;
break;
}
// Return the first episode

Loading…
Cancel
Save