diff options
| author | Fuwn <[email protected]> | 2026-06-05 14:48:42 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-06-05 14:48:42 +0000 |
| commit | 577be4ea3440c258689a560d3d1a6c2ae158592b (patch) | |
| tree | 763f658f5d785d64be43e2432052ec18e1e45f8f /src/lib/List/Anime | |
| parent | feat(schedule): add native track alongside sub and dub (diff) | |
| download | due.moe-577be4ea3440c258689a560d3d1a6c2ae158592b.tar.xz due.moe-577be4ea3440c258689a560d3d1a6c2ae158592b.zip | |
nextReleaseTime kept a just-aired release in the past for 5 minutes, showing a negative countdown and driving scheduleAiringRefresh into a 1-second revalidate loop. Always roll a past release to its next occurrence, and only arm the refresh timer on future airings.
Diffstat (limited to 'src/lib/List/Anime')
| -rw-r--r-- | src/lib/List/Anime/CleanAnimeList.svelte | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/List/Anime/CleanAnimeList.svelte b/src/lib/List/Anime/CleanAnimeList.svelte index f2077d20..3fd43244 100644 --- a/src/lib/List/Anime/CleanAnimeList.svelte +++ b/src/lib/List/Anime/CleanAnimeList.svelte @@ -157,6 +157,7 @@ const scheduleAiringRefresh = () => { return; } + const now = Date.now() / 1000; const nextAiringAt = media.reduce<number | null>((closest, currentMedia) => { if ( currentMedia.status !== "RELEASING" && @@ -166,7 +167,9 @@ const scheduleAiringRefresh = () => { const airingAt = currentMedia.nextAiringEpisode?.airingAt; - if (!airingAt) return closest; + // Only arm the timer for upcoming airings; a past airingAt would clamp the + // timeout to 1s and revalidate every second. + if (!airingAt || airingAt <= now) return closest; if (closest === null) return airingAt; return airingAt < closest ? airingAt : closest; |