From c042ff37b1e8f0b46dad7bb0f4feae1d1592c775 Mon Sep 17 00:00:00 2001 From: Trevor Mears Date: Thu, 22 Jan 2026 18:55:06 -0800 Subject: [PATCH] fix: next episode modal not displaying after resume from homepage. --- public/js/pages/HomePage.js | 19 +++++++++++++++++++ public/js/pages/WatchPage.js | 8 ++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/public/js/pages/HomePage.js b/public/js/pages/HomePage.js index 45793a0..6ddadc1 100644 --- a/public/js/pages/HomePage.js +++ b/public/js/pages/HomePage.js @@ -479,6 +479,25 @@ class HomePage { containerExtension: container }; + // For episodes, try to restore series data for next episode functionality + if (type === 'episode' && item.data) { + content.seriesId = item.data.seriesId || null; + content.currentSeason = item.data.currentSeason || null; + content.currentEpisode = item.data.currentEpisode || null; + + // Fetch seriesInfo if we have a seriesId + if (content.seriesId && sourceId) { + try { + const seriesInfo = await window.API.request('GET', `/proxy/xtream/${sourceId}/series_info?series_id=${content.seriesId}`); + if (seriesInfo) { + content.seriesInfo = seriesInfo; + } + } catch (e) { + console.warn('[Dashboard] Could not fetch seriesInfo for next episode:', e); + } + } + } + // Switch to watch page this.app.navigateTo('watch'); diff --git a/public/js/pages/WatchPage.js b/public/js/pages/WatchPage.js index 5120cd6..7a6528b 100644 --- a/public/js/pages/WatchPage.js +++ b/public/js/pages/WatchPage.js @@ -1381,13 +1381,17 @@ class WatchPage { subtitle: this.content.subtitle || (this.content.type === 'movie' ? 'Movie' : 'Series'), poster: this.content.poster, sourceId: this.content.sourceId, - containerExtension: this.containerExtension + containerExtension: this.containerExtension, + // Series-specific fields for next episode functionality + seriesId: this.content.seriesId || null, + currentSeason: this.currentSeason || null, + currentEpisode: this.currentEpisode || null }; await window.API.request('POST', '/history', { id: this.content.id, type: this.content.type === 'movie' ? 'movie' : 'episode', - sourceId: this.content.sourceId, // Add sourceId at top level for resume + sourceId: this.content.sourceId, progress, duration, data