This commit is contained in:
CodeDevMLH
2025-09-27 02:34:28 +02:00
parent 01469c1b06
commit c18282396c

View File

@@ -890,14 +890,14 @@ const checkNavigation = () => {
const isHomePage = url => url.includes('/home') || url.endsWith('/web/') || url.endsWith('/web/index.html'); const isHomePage = url => url.includes('/home') || url.endsWith('/web/') || url.endsWith('/web/index.html');
if (!isHomePage(newLocation) && isHomePageActive) { if (!isHomePage(newLocation) && isHomePageActive) {
console.log("Leaving homepage, cleaning up slideshow and stopping video"); console.log("Leaving home page, cleaning up slideshow and stopping video");
isHomePageActive = false; isHomePageActive = false;
stopBackgroundVideo(); stopBackgroundVideo();
cleanup(); cleanup();
} }
if (isHomePage(newLocation) && !isHomePageActive) { if (isHomePage(newLocation) && !isHomePageActive) {
console.log("Returning to homepage, reactivating slideshow"); console.log("Returning to home page, reactivating slideshow");
isHomePageActive = true; isHomePageActive = true;
fetchRandomMovie(); fetchRandomMovie();
} }
@@ -944,7 +944,7 @@ document.addEventListener('DOMContentLoaded', () => {
const isHomePage = url => url.includes('/home') || url.endsWith('/web/') || url.endsWith('/web/index.html'); const isHomePage = url => url.includes('/home') || url.endsWith('/web/') || url.endsWith('/web/index.html');
if (isHomePage(window.top.location.href)) { if (isHomePage(window.top.location.href)) {
isHomePageActive = true; isHomePageActive = true;
console.log("Homepage detected, starting slideshow"); console.log("Home page detected, starting slideshow");
readCustomList().then(list => { readCustomList().then(list => {
if (list) { movieList = list; currentMovieIndex = 0; } if (list) { movieList = list; currentMovieIndex = 0; }
fetchRandomMovie(); fetchRandomMovie();