mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
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>
|
/// <summary>
|
||||||
/// Adds the missing episodes.
|
/// Adds the missing episodes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -248,8 +250,7 @@ namespace MediaBrowser.Providers.TV
|
|||||||
|
|
||||||
var targetSeries = DetermineAppropriateSeries(series, tuple.Item1);
|
var targetSeries = DetermineAppropriateSeries(series, tuple.Item1);
|
||||||
|
|
||||||
var unairedThresholdDays = 2;
|
now = now.AddDays(0 - UnairedEpisodeThresholdDays);
|
||||||
now = now.AddDays(0 - unairedThresholdDays);
|
|
||||||
|
|
||||||
if (airDate.Value < now)
|
if (airDate.Value < now)
|
||||||
{
|
{
|
||||||
@ -329,10 +330,14 @@ namespace MediaBrowser.Providers.TV
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!allowMissingEpisodes && i.Episode.IsMissingEpisode && !i.Episode.IsUnaired)
|
if (!allowMissingEpisodes && i.Episode.IsMissingEpisode)
|
||||||
|
{
|
||||||
|
// 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 true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user