mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 09:12:57 +02:00
fix(server): server stats showing wrong quota usage (#10036)
* Add filter to exclude external libraries from the user quota usage * Add filter to exclude external libraries from the user quota usage * fix sql syntax
This commit is contained in:
parent
62f8bd80f4
commit
3c5ba77e86
2 changed files with 8 additions and 2 deletions
server/src/queries
|
@ -130,7 +130,13 @@ SELECT
|
|||
"assets"."type" = 'VIDEO'
|
||||
AND "assets"."isVisible"
|
||||
) AS "videos",
|
||||
COALESCE(SUM("exif"."fileSizeInByte"), 0) AS "usage"
|
||||
COALESCE(
|
||||
SUM("exif"."fileSizeInByte") FILTER (
|
||||
WHERE
|
||||
"assets"."libraryId" IS NULL
|
||||
),
|
||||
0
|
||||
) AS "usage"
|
||||
FROM
|
||||
"users" "users"
|
||||
LEFT JOIN "assets" "assets" ON "assets"."ownerId" = "users"."id"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue