mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
Update exclusive elsewhere script
This commit is contained in:
1 parent
a792f332c3
commit
051cf4b7e7
1 file changed
+39
-25
+39
-25
@@ -1,37 +1,51 @@
|
||||
/*
|
||||
Exclusive Elsewhere
|
||||
Modifies the behavior of the Jellyfin Enhanced Elsewhere functionality
|
||||
Adds custom branding when the item is not available on any selected streaming services
|
||||
// Exclusive Elsewhere Script
|
||||
// Modifies the behavior of the Jellyfin Enhanced Elsewhere functionality
|
||||
// Adds custom branding when the item is not available on any selected streaming services
|
||||
//
|
||||
// If you want to add an icon to the text you can do so by targeting the "exclusive" class.
|
||||
//
|
||||
// For example:
|
||||
// .streaming-lookup-container a.exclusive::after {
|
||||
// content: '';
|
||||
// background: url(/path/to/icon.png);
|
||||
// background-size: contain;
|
||||
// background-repeat: no-repeat;
|
||||
// width: 25px;
|
||||
// height: 25px;
|
||||
// display: inline-block;
|
||||
// margin-left: 0.5rem;
|
||||
// }
|
||||
|
||||
If you want to add an icon to the text you can do so by targeting the "exclusive" class.
|
||||
|
||||
For example:
|
||||
.streaming-lookup-container a.exclusive::after {
|
||||
content: '';
|
||||
background: url(/path/to/icon.png);
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
display: inline-block;
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
*/
|
||||
|
||||
(function () {
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
// Common logging function
|
||||
const LOG = (...args) => console.log('[ExclusiveElsewhere]', ...args);
|
||||
const WARN = (...args) => console.warn('[ExclusiveElsewhere]', ...args);
|
||||
const ERR = (...args) => console.error('[ExclusiveElsewhere]', ...args);
|
||||
|
||||
LOG('Script loaded - JS Injector mode');
|
||||
|
||||
const observer = new MutationObserver(() => {
|
||||
const elsewhereContainer = document.querySelector('.itemDetailPage:not(.hide) .streaming-lookup-container>div');
|
||||
if (elsewhereContainer && elsewhereContainer.children && elsewhereContainer.children.length > 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
const link = document.querySelector('.itemDetailPage:not(.hide) .streaming-lookup-container>div>div:first-child a');
|
||||
if (link && link.innerHTML.trim() === "Not available on any streaming services in Canada") {
|
||||
link.innerHTML = "Only available on ";
|
||||
if (link && !link.classList.contains('exclusive')) {
|
||||
LOG('Modifying elsewhere link to show exclusive branding');
|
||||
link.innerHTML = "Only available on Jellyfin";
|
||||
link.classList.add("exclusive");
|
||||
link.title = "24kev.in Exclusive"
|
||||
link.title = "Jellyfin Exclusive";
|
||||
link.disable = true;
|
||||
}
|
||||
});
|
||||
|
||||
observer.observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true,
|
||||
characterData: true
|
||||
subtree: true
|
||||
});
|
||||
|
||||
LOG('Exclusive elsewhere functionality initialized');
|
||||
})();
|
||||
Reference in new issue
Block a user