Item ID & Server ID javascript injector

Jellyfin-ID-Injector-Script

In Jellyfin, this adds the item ID# as an ID to the body tag of the page, and adds the serverID as a css class name.

Inspired by Werewolf by Night / Spider-Noir, I now have an easy way to theme individual library items - or change theming based on server.

This will grab the id & serverid from your URL and add it to the body tag of each page on load.

So, URL of https://mydomain.com/web/#/details?id=30a28ccb0a036ec6004708a56e20074b&serverId=31ee634b11af4a959a387160821b15a0

Will result in:

<body dir="ltr" id="item30a28ccb0a036ec6004708a56e20074b" class="server31ee634b11af4a959a387160821b15a0">

Then you can have your custom CSS code do stuff to certain entries, if you're so inclined. Yeah, it's a little silly, but that's part of the point of self-hosting - so we can do our own silly things!

In Short

This adds the item ID# as an ID to the body tag of the page, and adds the serverID as a css class name.

Prerequite

  1. Install JS Injector, a common plugin used by several major plugins. Restart Jellyfin to enable the plugin.

https://github.com/n00bcodr/Jellyfin-JavaScript-Injector

Setup

  1. Add a new script, give it a name, and paste the following code:

    document.addEventListener('viewshow', function(event) { const hashString = window.location.hash; queryPart = hashString.split('?')[1]; const params = new URLSearchParams(queryPart || ''); const idvalue = params.get('id'); const servervalue = params.get('serverId'); // Check if the ID exists and if the body element has loaded if (idvalue && document.body) { document.body.id = 'item' + idvalue; document.body.classList.add('server' + servervalue); console.log('ID Injector: Successfully added item ID to body tag'); } else if (idvalue && !document.body) { console.warn('ID Injector: Script ran before document.body was ready.'); } else if (!idvalue) { document.body.id = ""; console.warn('ID Injector: No ID found in URL to inject. Resetting to null.'); } });

I left my debugging/console notification code in there, feel free to remove/edit.

Version with no debugging/comments

document.addEventListener('viewshow', function(event) {
const hashString = window.location.hash;
queryPart = hashString.split('?')[1]; 
const params = new URLSearchParams(queryPart || '');
const idvalue = params.get('id');
const servervalue = params.get('serverId');
if (idvalue && document.body) { 
	document.body.id = 'item' + idvalue;
	document.body.classList.add('server' + servervalue);
	} else if (!idvalue) {
		document.body.id = "";
	}
});

MINIFIED (via https://www.minifier.org/):

document.addEventListener('viewshow',function(event){const hashString=window.location.hash;queryPart=hashString.split('?')[1];const params=new URLSearchParams(queryPart||'');const idvalue=params.get('id');const servervalue=params.get('serverId');if(idvalue&&document.body){document.body.id='item'+idvalue;document.body.classList.add('server'+servervalue)}else if(!idvalue){document.body.id=""}})
  1. Hit save.

  2. Write some custom CSS targeting it!

<img width="863" height="1028" alt="Screenshot 21" src="https://github.com/user-attachments/assets/9c4b2802-93eb-476d-b42d-5b967231b1ee" />

Example 1

If the ID# for Spider-Noir was "30a28ccb0a036ec6004708a56e20074b", then put this in your custom css:

/* Turn Spider-Noir's cast BW */
#item30a28ccb0a036ec6004708a56e20074b #castContent {
	filter: grayscale (1);
}

And now the cast and crew's pics are black & white!

Example 2

If you have multiple servers, but they're configured the same/look the same, (prod & test/live & development for example), you can use this to distinguish them. This code will turn the banner orangish, and put "DEV SERVER" in the top left - But only when you're connected to that server [and only when you're on an item page; pages without serverid in the URL won't be lit up, such as the home page]

.server31ee634b11af4a959a387160821b15a0 .skinHeader.semiTransparent {
	background-color: rgb(234 124 15 / 60%) !important;
}
.server31ee634b11af4a959a387160821b15a0 .headerLeft::after {
	content: "DEV SERVER";
    font-size: larger;
    font-weight: bolder;
}

AI Disclaimer: AI was used for debugging; figuring out why what I wrote didn't work (damn typos). that's it.

reddit.com
u/TheDMV2 — 4 days ago
▲ 6 r/VLC

What method of sharpening does VLC use?

In VLC, you can enable sharpening:

Window -> Video Effects -> Sharpen -> Sigma and there's a slider scale.

This makes older anime/cartoons/animation look amazing, like it's been AI upscaled without the insane CPU overheard.

I'd like to include this sort of sharpening in some of my transcodes.

My question is: what method of sharpening does VLC use for this?

I want to duplicate it, but I'm not sure what filters/programs/apps would do the same thing.

reddit.com
u/TheDMV2 — 4 days ago
▲ 3 r/AV1

VLC 'Sigma' Sharpening in AV1 to improve animation edge sharpness?

In VLC, you can enable sharpening:

Window -> Video Effects -> Sharpen -> Sigma and there's a slider scale.

This makes older anime/cartoons/animation look amazing, like it's been AI upscaled without the insane CPU overheard. I'd like to include this sort of sharpening in some of my AV1 transcodes.

Everything I read online about VLC sharpening is just "click to enable", without any information about the method it uses under the hood.

In AV1, is there a sharpening method which is the same, to hardcode it?

I'm not familiar with the AV1 method that "Sharpness=X" uses, nor if there are other ffmpeg commands unrelated to AV1, but since I'm using AV1, I thought I'd ask here first.

reddit.com
u/TheDMV2 — 4 days ago

Item ID &amp; Server ID javascript injector

Jellyfin-ID-Injector-Script

In Jellyfin, this adds the item ID# as an ID to the body tag of the page, and adds the serverID as a css class name.

Inspired by Werewolf by Night / Spider-Noir, I now have an easy way to theme individual library items - or change theming based on server.

This will grab the id & serverid from your URL and add it to the body tag of each page on load.

So, URL of https://mydomain.com/web/#/details?id=30a28ccb0a036ec6004708a56e20074b&serverId=31ee634b11af4a959a387160821b15a0

Will result in:

&lt;body dir="ltr" id="item30a28ccb0a036ec6004708a56e20074b" class="server31ee634b11af4a959a387160821b15a0"&gt;

Then you can have your custom CSS code do stuff to certain entries, if you're so inclined. Yeah, it's a little silly, but that's part of the point of self-hosting - so we can do our own silly things!

In Short

This adds the item ID# as an ID to the body tag of the page, and adds the serverID as a css class name.

Prerequite

  1. Install JS Injector, a common plugin used by several major plugins. Restart Jellyfin to enable the plugin.

https://github.com/n00bcodr/Jellyfin-JavaScript-Injector

Setup

  1. Add a new script, give it a name, and paste the following code:

    document.addEventListener('viewshow', function(event) { const hashString = window.location.hash; queryPart = hashString.split('?')[1]; const params = new URLSearchParams(queryPart || ''); const idvalue = params.get('id'); const servervalue = params.get('serverId'); // Check if the ID exists and if the body element has loaded if (idvalue && document.body) { document.body.id = 'item' + idvalue; document.body.classList.add('server' + servervalue); console.log('ID Injector: Successfully added item ID to body tag'); } else if (idvalue && !document.body) { console.warn('ID Injector: Script ran before document.body was ready.'); } else if (!idvalue) { document.body.id = ""; console.warn('ID Injector: No ID found in URL to inject. Resetting to null.'); } });

I left my debugging/console notification code in there, feel free to remove/edit.

Version with no debugging/comments

document.addEventListener('viewshow', function(event) {
const hashString = window.location.hash;
queryPart = hashString.split('?')[1]; 
const params = new URLSearchParams(queryPart || '');
const idvalue = params.get('id');
const servervalue = params.get('serverId');
if (idvalue &amp;&amp; document.body) { 
	document.body.id = 'item' + idvalue;
	document.body.classList.add('server' + servervalue);
	} else if (!idvalue) {
		document.body.id = "";
	}
});

MINIFIED (via https://www.minifier.org/):

document.addEventListener('viewshow',function(event){const hashString=window.location.hash;queryPart=hashString.split('?')[1];const params=new URLSearchParams(queryPart||'');const idvalue=params.get('id');const servervalue=params.get('serverId');if(idvalue&amp;&amp;document.body){document.body.id='item'+idvalue;document.body.classList.add('server'+servervalue)}else if(!idvalue){document.body.id=""}})
  1. Hit save.

  2. Write some custom CSS targeting it!

<img width="863" height="1028" alt="Screenshot 21" src="https://github.com/user-attachments/assets/9c4b2802-93eb-476d-b42d-5b967231b1ee" />

Example 1

If the ID# for Spider-Noir was "30a28ccb0a036ec6004708a56e20074b", then put this in your custom css:

/* Turn Spider-Noir's cast BW */
#item30a28ccb0a036ec6004708a56e20074b #castContent {
	filter: grayscale (1);
}

And now the cast and crew's pics are black & white!

Example 2

If you have multiple servers, but they're configured the same/look the same, (prod & test/live & development for example), you can use this to distinguish them. This code will turn the banner orangish, and put "DEV SERVER" in the top left - But only when you're connected to that server [and only when you're on an item page; pages without serverid in the URL won't be lit up, such as the home page]

.server31ee634b11af4a959a387160821b15a0 .skinHeader.semiTransparent {
	background-color: rgb(234 124 15 / 60%) !important;
}
.server31ee634b11af4a959a387160821b15a0 .headerLeft::after {
	content: "DEV SERVER";
    font-size: larger;
    font-weight: bolder;
}
reddit.com
u/TheDMV2 — 13 days ago