diff options
Diffstat (limited to 'src/lib/Media/Anime/Airing/match.ts')
| -rw-r--r-- | src/lib/Media/Anime/Airing/match.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/Media/Anime/Airing/match.ts b/src/lib/Media/Anime/Airing/match.ts index 9cfe6102..1994b300 100644 --- a/src/lib/Media/Anime/Airing/match.ts +++ b/src/lib/Media/Anime/Airing/match.ts @@ -144,7 +144,9 @@ const findScheduleEntry = ( // Resolve the next future release time for a matched entry. AnimeSchedule gives // the current week's episode; a delay window or a weekly cadence rolls a past -// release forward to the next occurrence. +// release forward to the next occurrence. This must never return a past time — +// a stuck-in-the-past airingAt produces a negative countdown and a tight +// refresh loop (see scheduleAiringRefresh). const nextReleaseTime = ( entry: AiringEntry, nowEpochSeconds: number, @@ -155,7 +157,7 @@ const nextReleaseTime = ( const base = entry.airingAt; if (!base) return 0; - if (base > nowEpochSeconds - STALE_AIRING_GRACE_SECONDS) return base; + if (base > nowEpochSeconds) return base; const weeksElapsed = Math.ceil((nowEpochSeconds - base) / SEVEN_DAYS_SECONDS); |