From e7410ec22aa1d195404e2b9fa817879af8b5900d Mon Sep 17 00:00:00 2001 From: CodeDevMLH <145071728+CodeDevMLH@users.noreply.github.com> Date: Fri, 13 Feb 2026 14:48:07 +0100 Subject: [PATCH] Fix slideshow preloading logic to prevent redundant slide creation --- Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js | 4 ++++ 1 file changed, 4 insertions(+) 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); }