From 8e1c85fe4f7d47925aaf0d3309dda4a23ba3a5a2 Mon Sep 17 00:00:00 2001
From: Alex <alex.tran1502@gmail.com>
Date: Sun, 18 Feb 2024 12:17:53 -0600
Subject: [PATCH] fix(server): not in album filter show motion part of
 LivePhotos (#7175)

---
 server/src/infra/infra.utils.ts | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/server/src/infra/infra.utils.ts b/server/src/infra/infra.utils.ts
index 2b274cb12a..d9eb823639 100644
--- a/server/src/infra/infra.utils.ts
+++ b/server/src/infra/infra.utils.ts
@@ -178,7 +178,10 @@ export function searchAssetBuilder(
   );
 
   if (options.isNotInAlbum) {
-    builder.leftJoin(`${builder.alias}.albums`, 'albums').andWhere('albums.id IS NULL');
+    builder
+      .leftJoin(`${builder.alias}.albums`, 'albums')
+      .andWhere('albums.id IS NULL')
+      .andWhere(`${builder.alias}.isVisible = true`);
   }
 
   if (options.withFaces || options.withPeople) {