From 926ff075a37c2dda2c58924ee841e9f5120a2e8c Mon Sep 17 00:00:00 2001 From: Daimolean <92239625+wuzihao051119@users.noreply.github.com> Date: Thu, 26 Jun 2025 23:46:34 +0800 Subject: [PATCH] fix(web): absolute path match in external library (#19551) --- server/src/repositories/view-repository.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/repositories/view-repository.ts b/server/src/repositories/view-repository.ts index 03e8b3763f..3a498d5b3e 100644 --- a/server/src/repositories/view-repository.ts +++ b/server/src/repositories/view-repository.ts @@ -22,12 +22,12 @@ export class ViewRepository { .where('localDateTime', 'is not', null) .execute(); - return results.map((row) => row.directoryPath.replaceAll(/^\/|\/$/g, '')); + return results.map((row) => row.directoryPath.replaceAll(/\/$/g, '')); } @GenerateSql({ params: [DummyValue.UUID, DummyValue.STRING] }) async getAssetsByOriginalPath(userId: string, partialPath: string) { - const normalizedPath = partialPath.replaceAll(/^\/|\/$/g, ''); + const normalizedPath = partialPath.replaceAll(/\/$/g, ''); return this.db .selectFrom('assets')