mirror of
https://github.com/immich-app/immich.git
synced 2025-07-03 21:40:00 +02:00
fix(server): storage usage calculation for motion photos (#8722)
* ignore non external assets in external libraries during syncUsage * only update storage usage if asset is from internal libraries * update storage usage on motion photo video asset creation * updated metadata service tests * added a test * simplified syncUsage condition * check for library type upload instead of not external * fixed broken sql --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
parent
6d4d0f86cf
commit
17dc12cf7d
5 changed files with 50 additions and 4 deletions
server/src/queries
|
@ -159,10 +159,12 @@ SET
|
|||
COALESCE(SUM(exif."fileSizeInByte"), 0)
|
||||
FROM
|
||||
"assets" "assets"
|
||||
LEFT JOIN "libraries" "library" ON "library"."id" = "assets"."libraryId"
|
||||
AND ("library"."deletedAt" IS NULL)
|
||||
LEFT JOIN "exif" "exif" ON "exif"."assetId" = "assets"."id"
|
||||
WHERE
|
||||
"assets"."ownerId" = users.id
|
||||
AND NOT "assets"."isExternal"
|
||||
AND "library"."type" = 'UPLOAD'
|
||||
),
|
||||
"updatedAt" = CURRENT_TIMESTAMP
|
||||
WHERE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue