浏览代码

feat(immich): add disable picture-in-picture patch

Zander Hawke 7 月之前
父节点
当前提交
2ab26fd027
共有 2 个文件被更改,包括 34 次插入5 次删除
  1. 22 5
      overlays/default.nix
  2. 12 0
      overlays/disable-picture-in-picture.patch

+ 22 - 5
overlays/default.nix

@@ -11,11 +11,28 @@ rec {
     # ...
     # });
 
-    immich = prev.immich.overrideAttrs (oldAttrs: {
-      patches = (oldAttrs.patches or [ ]) ++ [
-        ./video-geolocation.patch
-      ];
-    });
+    immich = prev.immich.overrideAttrs (oldAttrs:
+      let
+        patchedWeb = oldAttrs.passthru.web.overrideAttrs (webOld: {
+          patches = (webOld.patches or [ ]) ++ [
+            ./disable-picture-in-picture.patch
+          ];
+        });
+      in
+      {
+        patches = (oldAttrs.patches or [ ]) ++ [
+          ./video-geolocation.patch
+        ];
+
+        passthru = oldAttrs.passthru // {
+          web = patchedWeb;
+        };
+
+        postInstall = ''
+          rm -f $out/lib/node_modules/immich/build/www
+          ln -s '${patchedWeb}' $out/lib/node_modules/immich/build/www
+        '';
+      });
 
     makeModulesClosure = x: prev.makeModulesClosure (x // { allowMissing = true; });
 

+ 12 - 0
overlays/disable-picture-in-picture.patch

@@ -0,0 +1,12 @@
+diff --git a/web/src/lib/components/asset-viewer/video-native-viewer.svelte b/web/src/lib/components/asset-viewer/video-native-viewer.svelte
+index 2ccfb5924..92c467bc1 100644
+--- a/web/src/lib/components/asset-viewer/video-native-viewer.svelte
++++ b/web/src/lib/components/asset-viewer/video-native-viewer.svelte
+@@ -140,6 +140,7 @@
+         autoplay={$autoPlayVideo}
+         playsinline
+         controls
++        disablePictureInPicture
+         class="h-full object-contain"
+         {...useSwipe(onSwipe)}
+         oncanplay={(e) => handleCanPlay(e.currentTarget)}