mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
more jquery removal
This commit is contained in:
parent
020b1d9a64
commit
c389dc9473
2 changed files with 13 additions and 14 deletions
|
@ -238,9 +238,16 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
|
|
||||||
public IEnumerable<Episode> GetEpisodes(User user, bool includeMissing, bool includeVirtualUnaired)
|
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))
|
.SelectMany(i => i.GetEpisodes(this, user, includeMissing, includeVirtualUnaired, allSeriesEpisodes))
|
||||||
.Reverse()
|
.Reverse()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
|
@ -125,7 +125,7 @@ namespace MediaBrowser.Server.Implementations.TV
|
||||||
private Tuple<Episode, DateTime, bool> GetNextUp(Series series, User user)
|
private Tuple<Episode, DateTime, bool> GetNextUp(Series series, User user)
|
||||||
{
|
{
|
||||||
// Get them in display order, then reverse
|
// 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)
|
.Where(i => !i.ParentIndexNumber.HasValue || i.ParentIndexNumber.Value != 0)
|
||||||
.Reverse()
|
.Reverse()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
@ -134,8 +134,6 @@ namespace MediaBrowser.Server.Implementations.TV
|
||||||
var lastWatchedDate = DateTime.MinValue;
|
var lastWatchedDate = DateTime.MinValue;
|
||||||
Episode nextUp = null;
|
Episode nextUp = null;
|
||||||
|
|
||||||
var includeMissing = user.Configuration.DisplayMissingEpisodes;
|
|
||||||
|
|
||||||
var unplayedEpisodes = new List<Episode>();
|
var unplayedEpisodes = new List<Episode>();
|
||||||
|
|
||||||
// Go back starting with the most recent episodes
|
// Go back starting with the most recent episodes
|
||||||
|
@ -157,12 +155,9 @@ namespace MediaBrowser.Server.Implementations.TV
|
||||||
{
|
{
|
||||||
unplayedEpisodes.Add(episode);
|
unplayedEpisodes.Add(episode);
|
||||||
|
|
||||||
if (!episode.IsVirtualUnaired && (includeMissing || !episode.IsMissingEpisode))
|
|
||||||
{
|
|
||||||
nextUp = episode;
|
nextUp = episode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (lastWatched != null)
|
if (lastWatched != null)
|
||||||
{
|
{
|
||||||
|
@ -175,12 +170,9 @@ namespace MediaBrowser.Server.Implementations.TV
|
||||||
{
|
{
|
||||||
var unplayedEpisode = unplayedEpisodes[i];
|
var unplayedEpisode = unplayedEpisodes[i];
|
||||||
|
|
||||||
if (!unplayedEpisode.IsVirtualUnaired && (includeMissing || !unplayedEpisode.IsMissingEpisode))
|
|
||||||
{
|
|
||||||
firstEpisode = unplayedEpisode;
|
firstEpisode = unplayedEpisode;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Return the first episode
|
// Return the first episode
|
||||||
return new Tuple<Episode, DateTime, bool>(firstEpisode, DateTime.MinValue, true);
|
return new Tuple<Episode, DateTime, bool>(firstEpisode, DateTime.MinValue, true);
|
||||||
|
|
Loading…
Reference in a new issue