This commit is contained in:
Huan Liu 2025-04-15 04:52:06 +08:00 committed by GitHub
commit 4194c90f81
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(); btnPause.classList.contains('hidden') ? btnPlay.click() : btnPause.click();
} else if (key === 'ArrowDown' || key === 'ArrowUp') { } else if (key === 'ArrowDown' || key === 'ArrowUp') {
const episodes = {{ episodes }}; // Access episodes directly from the Jinja template 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 lowestEpisodeId = episodes.at(0);
const highestEpisodeId = episodes.at(-1); const highestEpisodeId = episodes.at(-1);
if (nextEpisodeId >= lowestEpisodeId && nextEpisodeId <= highestEpisodeId) { if (nextEpisodeId >= lowestEpisodeId && nextEpisodeId <= highestEpisodeId) {