|
|
@ -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);
|
|
|
|