diff options
| author | Fuwn <[email protected]> | 2024-02-11 07:27:04 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-02-11 07:27:04 -0800 |
| commit | 6d0da2f6add7f9ab04d2333601ad3654159c4812 (patch) | |
| tree | 2d99dbdac1b4f6e42edeeeaf16fe54a0935231d1 /src | |
| parent | fix(badges): prevent default on phony link (diff) | |
| download | due.moe-6d0da2f6add7f9ab04d2333601ad3654159c4812.tar.xz due.moe-6d0da2f6add7f9ab04d2333601ad3654159c4812.zip | |
fix(match): no match for unaired
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/Media/Anime/Airing/Subtitled/match.ts | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/lib/Media/Anime/Airing/Subtitled/match.ts b/src/lib/Media/Anime/Airing/Subtitled/match.ts index bad0d20d..ad26131c 100644 --- a/src/lib/Media/Anime/Airing/Subtitled/match.ts +++ b/src/lib/Media/Anime/Airing/Subtitled/match.ts @@ -159,15 +159,17 @@ export const injectAiringTime = (anime: Media, subsPlease: SubsPlease | null) => } } - const foundTime: Time | null = findClosestMatch(times, [ - anime.title.romaji, - anime.title.english, - ...anime.synonyms - ]); - - if (foundTime) { - untilAiring = secondsUntil((foundTime as Time).time, (foundTime as Time).day); - time = new Date(Date.now() + untilAiring * 1000); + if ((anime.nextAiringEpisode?.episode || 0) > 1) { + const foundTime: Time | null = findClosestMatch(times, [ + anime.title.romaji, + anime.title.english, + ...anime.synonyms + ]); + + if (foundTime) { + untilAiring = secondsUntil((foundTime as Time).time, (foundTime as Time).day); + time = new Date(Date.now() + untilAiring * 1000); + } } } |