fix: external library statistics for excluded assets (#28462)

Fix external library statistics for excluded assets
This commit is contained in:
Mimi 2026-08-28 01:34:10 +08:00 committed by GitHub
parent 48b5f9c6a6
commit 91d362eb9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -51,7 +51,8 @@ from
inner join "asset" on "asset"."libraryId" = "library"."id"
left join "asset_exif" on "asset_exif"."assetId" = "asset"."id"
where
"library"."id" = $6
"asset"."deletedAt" is null
and "library"."id" = $6
group by
"library"."id"
select

View file

@ -92,6 +92,7 @@ export class LibraryRepository {
.as('videos'),
)
.select((eb) => eb.fn.coalesce((eb) => eb.fn.sum('asset_exif.fileSizeInByte'), eb.val(0)).as('usage'))
.where('asset.deletedAt', 'is', null)
.groupBy('library.id')
.where('library.id', '=', id)
.executeTakeFirst();