1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-07 23:03:36 +02:00

fix(web): absolute path match in external library (#19551)

This commit is contained in:
Daimolean
2025-06-26 23:46:34 +08:00
committed by GitHub
parent 934649c8df
commit 926ff075a3

View File

@ -22,12 +22,12 @@ export class ViewRepository {
.where('localDateTime', 'is not', null) .where('localDateTime', 'is not', null)
.execute(); .execute();
return results.map((row) => row.directoryPath.replaceAll(/^\/|\/$/g, '')); return results.map((row) => row.directoryPath.replaceAll(/\/$/g, ''));
} }
@GenerateSql({ params: [DummyValue.UUID, DummyValue.STRING] }) @GenerateSql({ params: [DummyValue.UUID, DummyValue.STRING] })
async getAssetsByOriginalPath(userId: string, partialPath: string) { async getAssetsByOriginalPath(userId: string, partialPath: string) {
const normalizedPath = partialPath.replaceAll(/^\/|\/$/g, ''); const normalizedPath = partialPath.replaceAll(/\/$/g, '');
return this.db return this.db
.selectFrom('assets') .selectFrom('assets')