diff --git a/server/src/infra/repositories/user.repository.ts b/server/src/infra/repositories/user.repository.ts index 4990893014..5d55eea1f6 100644 --- a/server/src/infra/repositories/user.repository.ts +++ b/server/src/infra/repositories/user.repository.ts @@ -121,7 +121,7 @@ export class UserRepository implements IUserRepository { .createQueryBuilder('assets') .select('COALESCE(SUM(exif."fileSizeInByte"), 0)') .leftJoin('assets.exifInfo', 'exif') - .where('assets.ownerId = users.id') + .where('assets.ownerId = users.id AND NOT assets.isExternal') .withDeleted(); const query = this.userRepository diff --git a/server/src/infra/sql/user.repository.sql b/server/src/infra/sql/user.repository.sql index f773f27835..40cf14077a 100644 --- a/server/src/infra/sql/user.repository.sql +++ b/server/src/infra/sql/user.repository.sql @@ -162,6 +162,7 @@ SET LEFT JOIN "exif" "exif" ON "exif"."assetId" = "assets"."id" WHERE "assets"."ownerId" = users.id + AND NOT "assets"."isExternal" ), "updatedAt" = CURRENT_TIMESTAMP WHERE