Updated cacheing to use persistent json cache
This commit is contained in:
@@ -106,6 +106,11 @@ const API = {
|
||||
epg: {
|
||||
get: (sourceId) => API.request('GET', `/proxy/epg/${sourceId}`),
|
||||
getForChannels: (sourceId, channelIds) => API.request('POST', `/proxy/epg/${sourceId}/channels`, { channelIds })
|
||||
},
|
||||
|
||||
// Cache management
|
||||
cache: {
|
||||
clear: (sourceId) => API.request('DELETE', `/proxy/cache/${sourceId}`)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -294,10 +294,13 @@ class SourceManager {
|
||||
btn.textContent = '⏳';
|
||||
}
|
||||
|
||||
// Clear cache for this source first
|
||||
await API.proxy.cache.clear(id);
|
||||
|
||||
if (type === 'epg') {
|
||||
// Force refresh EPG data (server-side cache will be bypassed)
|
||||
// Force refresh EPG data
|
||||
if (window.app?.epgGuide) {
|
||||
await window.app.epgGuide.loadEpg(true); // Force refresh
|
||||
await window.app.epgGuide.loadEpg(true);
|
||||
}
|
||||
alert('EPG data refreshed!');
|
||||
} else if (type === 'xtream') {
|
||||
|
||||
@@ -12,8 +12,13 @@ class GuidePage {
|
||||
}
|
||||
|
||||
async show() {
|
||||
// Always reload EPG data when page is shown to ensure fresh data
|
||||
await this.app.epgGuide.loadEpg();
|
||||
// Only load EPG data if not already loaded
|
||||
if (!this.app.epgGuide.programmes || this.app.epgGuide.programmes.length === 0) {
|
||||
await this.app.epgGuide.loadEpg();
|
||||
} else {
|
||||
// Just re-render with existing data (updates time position)
|
||||
this.app.epgGuide.render();
|
||||
}
|
||||
}
|
||||
|
||||
hide() {
|
||||
|
||||
Reference in New Issue
Block a user