diff --git a/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js b/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js index 96869f6..a1b98ec 100644 --- a/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js +++ b/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js @@ -2437,6 +2437,8 @@ const SlideshowManager = { // Preload next slides for (let i = 1; i <= preloadCount; i++) { const nextIndex = (currentIndex + i) % totalItems; + if (nextIndex === currentIndex) break; + const itemId = STATE.slideshow.itemIds[nextIndex]; SlideCreator.createSlideForItemId(itemId); } @@ -2444,6 +2446,8 @@ const SlideshowManager = { // Preload previous slides for (let i = 1; i <= preloadCount; i++) { const prevIndex = (currentIndex - i + totalItems) % totalItems; + if (prevIndex === currentIndex) break; + const prevItemId = STATE.slideshow.itemIds[prevIndex]; SlideCreator.createSlideForItemId(prevItemId); }