feat(servers): enable skip intro button in jellyfin-web
All checks were successful
Discord / discord commits (push) Successful in 36s

This commit is contained in:
matt1432 2024-03-08 14:36:52 -05:00
parent 9a19aee4d2
commit 92bf9267ca

View file

@ -10,28 +10,43 @@
if config.nvidia.enableCUDA
then pkgs.cudaPackages.pkgs
else pkgs;
jellyWeb = jellyPkgs.jellyfin-web.overrideAttrs (_: o: {
# Inject skip intro button
patches =
[
(pkgs.fetchpatch {
name = "skipintro.patch";
url = "https://pastebin.com/raw/EEgvReaw";
hash = "sha256-kfvOz0ukDY09kkbmZi24ch5KWJsVcThNEVnjlk4sAC0=";
})
]
++ optionals (hasAttr "patches" o) o.patches;
# Enable backdrops by default. Not sure if it actually works
postInstall = ''
substituteInPlace $out/share/jellyfin-web/main.jellyfin.bundle.js \
--replace-fail \
'enableBackdrops:function(){return P}' \
'enableBackdrops:function(){return _}'
'';
});
jellyfinPkg = jellyPkgs.jellyfin.overrideAttrs (_: o: {
# This was the only way I found to replace the jellyfin-web package
preInstall = ''
makeWrapperArgs+=(
--add-flags "--ffmpeg ${jellyPkgs.jellyfin-ffmpeg}/bin/ffmpeg"
--add-flags "--webdir ${jellyWeb}/share/jellyfin-web"
)
'';
});
in {
services.jellyfin.package = jellyPkgs.jellyfin;
services.jellyfin.package = jellyfinPkg;
environment.systemPackages = [
jellyPkgs.jellyfin
jellyfinPkg
jellyWeb
jellyPkgs.jellyfin-ffmpeg
(jellyPkgs.jellyfin-web.overrideAttrs (_: o: {
patches =
[
(pkgs.fetchpatch {
name = "skipintro.patch";
url = "https://pastebin.com/raw/EEgvReaw";
hash = "sha256-kfvOz0ukDY09kkbmZi24ch5KWJsVcThNEVnjlk4sAC0=";
})
]
++ optionals (hasAttr "patches" o) o.patches;
# Enable backdrops by default
postInstall = ''
sed -E -i 's/enableBackdrops\:function\(\)\{return P\}/enableBackdrops\:function\(\)\{return \_\}/' $out/share/jellyfin-web/main.jellyfin.bundle.js
'';
}))
];
}