fix: next episode modal not displaying after resume from homepage.
This commit is contained in:
@@ -479,6 +479,25 @@ class HomePage {
|
|||||||
containerExtension: container
|
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
|
// Switch to watch page
|
||||||
this.app.navigateTo('watch');
|
this.app.navigateTo('watch');
|
||||||
|
|
||||||
|
|||||||
@@ -1381,13 +1381,17 @@ class WatchPage {
|
|||||||
subtitle: this.content.subtitle || (this.content.type === 'movie' ? 'Movie' : 'Series'),
|
subtitle: this.content.subtitle || (this.content.type === 'movie' ? 'Movie' : 'Series'),
|
||||||
poster: this.content.poster,
|
poster: this.content.poster,
|
||||||
sourceId: this.content.sourceId,
|
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', {
|
await window.API.request('POST', '/history', {
|
||||||
id: this.content.id,
|
id: this.content.id,
|
||||||
type: this.content.type === 'movie' ? 'movie' : 'episode',
|
type: this.content.type === 'movie' ? 'movie' : 'episode',
|
||||||
sourceId: this.content.sourceId, // Add sourceId at top level for resume
|
sourceId: this.content.sourceId,
|
||||||
progress,
|
progress,
|
||||||
duration,
|
duration,
|
||||||
data
|
data
|
||||||
|
|||||||
Reference in New Issue
Block a user