cache-bust catalog.json (?_=Date.now) so Lampa.Reguest serves fresh content

This commit is contained in:
Hermes committed 2026-08-08 21:13:14 +02:00
1 parent 46938814df
commit 5a9b4a56ba
1 file changed
+7 -1
+7 -1
View File
@@ -16,6 +16,12 @@
return base() + p.replace(/^\/+/, '');
}
// Append a cache-busting param so Lampa.Reguest does not serve a stale copy.
function bust(url) {
var sep = url.indexOf('?') >= 0 ? '&' : '?';
return url + sep + '_=' + Date.now();
}
function esc(s) {
return String(s == null ? '' : s)
.replace(/&/g, '&amp;').replace(/</g, '&lt;')
@@ -24,7 +30,7 @@
// Load catalog via Lampa native network layer (TV-safe, fetch fails on some devices)
function loadCatalog(cb) {
var url = base() + 'movies/catalog.json';
var url = bust(base() + 'movies/catalog.json');
if (Lampa.Reguest && Lampa.Reguest.get) {
Lampa.Reguest.get(url, function (html) {
try {