This commit is contained in:
Huan Liu 2025-04-10 17:21:41 +09:00 committed by GitHub
commit e6a5356d6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -532,7 +532,8 @@
btnPause.classList.contains('hidden') ? btnPlay.click() : btnPause.click();
} else if (key === 'ArrowDown' || key === 'ArrowUp') {
const episodes = {{ episodes }}; // Access episodes directly from the Jinja template
const nextEpisodeId = key === 'ArrowDown' ? {{ episode_id }} + 1 : {{ episode_id }} - 1;
const currentIndex = episodes.indexOf({{ episode_id }});
const nextEpisodeId = key === 'ArrowDown' ? episodes.at(currentIndex + 1) : episodes.at(currentIndex - 1);
const lowestEpisodeId = episodes.at(0);
const highestEpisodeId = episodes.at(-1);
if (nextEpisodeId >= lowestEpisodeId && nextEpisodeId <= highestEpisodeId) {