|
|
@ -106,7 +106,7 @@ namespace NzbDrone.Core.Tv
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static bool GetMonitoredStatus(Episode episode, IEnumerable<Season> seasons)
|
|
|
|
private bool GetMonitoredStatus(Episode episode, IEnumerable<Season> seasons)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (episode.EpisodeNumber == 0 && episode.SeasonNumber != 1)
|
|
|
|
if (episode.EpisodeNumber == 0 && episode.SeasonNumber != 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -117,17 +117,23 @@ namespace NzbDrone.Core.Tv
|
|
|
|
return season == null || season.Monitored;
|
|
|
|
return season == null || season.Monitored;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static void AdjustMultiEpisodeAirTime(Series series, IEnumerable<Episode> allEpisodes)
|
|
|
|
private void AdjustMultiEpisodeAirTime(Series series, IEnumerable<Episode> allEpisodes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var groups =
|
|
|
|
if (series.Network == "Netflix")
|
|
|
|
allEpisodes.Where(c => c.AirDateUtc.HasValue)
|
|
|
|
{
|
|
|
|
.GroupBy(e => new { e.SeasonNumber, e.AirDate })
|
|
|
|
_logger.Debug("Not adjusting episode air times for Netflix series {0}", series.Title);
|
|
|
|
.Where(g => g.Count() > 1)
|
|
|
|
return;
|
|
|
|
.ToList();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var groups = allEpisodes.Where(c => c.AirDateUtc.HasValue)
|
|
|
|
|
|
|
|
.GroupBy(e => new {e.SeasonNumber, e.AirDate})
|
|
|
|
|
|
|
|
.Where(g => g.Count() > 1)
|
|
|
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var group in groups)
|
|
|
|
foreach (var group in groups)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var episodeCount = 0;
|
|
|
|
var episodeCount = 0;
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var episode in group.OrderBy(e => e.SeasonNumber).ThenBy(e => e.EpisodeNumber))
|
|
|
|
foreach (var episode in group.OrderBy(e => e.SeasonNumber).ThenBy(e => e.EpisodeNumber))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
episode.AirDateUtc = episode.AirDateUtc.Value.AddMinutes(series.Runtime * episodeCount);
|
|
|
|
episode.AirDateUtc = episode.AirDateUtc.Value.AddMinutes(series.Runtime * episodeCount);
|
|
|
@ -136,7 +142,7 @@ namespace NzbDrone.Core.Tv
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static void AdjustDirectToDvdAirDate(Series series, IEnumerable<Episode> allEpisodes)
|
|
|
|
private void AdjustDirectToDvdAirDate(Series series, IEnumerable<Episode> allEpisodes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (series.Status == SeriesStatusType.Ended && allEpisodes.All(v => !v.AirDateUtc.HasValue) && series.FirstAired.HasValue)
|
|
|
|
if (series.Status == SeriesStatusType.Ended && allEpisodes.All(v => !v.AirDateUtc.HasValue) && series.FirstAired.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|