refactor: add mark_watched parameter with JavaScript

This commit is contained in:
Gus Libens 2025-12-06 23:03:34 +01:00
parent 4b6037b658
commit edc726858b
No known key found for this signature in database
GPG key ID: 032E49D0FE9D51EA

View file

@ -146,4 +146,15 @@
event.preventDefault();
}
});
// Handle the video watched state with JavaScript (if enabled)
const anchorElements = document.querySelectorAll('a[href^="/watch"]');
for (const anchorElement of anchorElements) {
const url = new URL(anchorElement.href);
url.searchParams.set("mark_watched", "0");
anchorElement.href = url.href;
}
})();