fix MissingEpisodeProvider repeatedly adding and removing unaired items
This commit is contained in:
parent
db4e0a38e9
commit
4f76955563
|
@ -191,6 +191,8 @@ namespace MediaBrowser.Providers.TV
|
|||
});
|
||||
}
|
||||
|
||||
private const double UnairedEpisodeThresholdDays = 2;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the missing episodes.
|
||||
/// </summary>
|
||||
|
@ -248,8 +250,7 @@ namespace MediaBrowser.Providers.TV
|
|||
|
||||
var targetSeries = DetermineAppropriateSeries(series, tuple.Item1);
|
||||
|
||||
var unairedThresholdDays = 2;
|
||||
now = now.AddDays(0 - unairedThresholdDays);
|
||||
now = now.AddDays(0 - UnairedEpisodeThresholdDays);
|
||||
|
||||
if (airDate.Value < now)
|
||||
{
|
||||
|
@ -329,9 +330,13 @@ namespace MediaBrowser.Providers.TV
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!allowMissingEpisodes && i.Episode.IsMissingEpisode && !i.Episode.IsUnaired)
|
||||
if (!allowMissingEpisodes && i.Episode.IsMissingEpisode)
|
||||
{
|
||||
return true;
|
||||
// If it's missing, but not unaired, remove it
|
||||
if (!i.Episode.PremiereDate.HasValue || i.Episode.PremiereDate.Value.ToLocalTime().Date.AddDays(UnairedEpisodeThresholdDays) < DateTime.Now.Date)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue
Block a user