From 9ebed3c1b421d2108981159905a83c9728779fba Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 21 Feb 2023 21:51:04 -0600 Subject: [PATCH] fix(server): Object detection query and get server stats (#1823) * fix(server): Object detection query has incorrect value * fix: get stats for user using the wrong property id from response * chore: update openapi version --- mobile/openapi/README.md | Bin 13609 -> 13609 bytes .../src/api-v1/asset/asset-repository.ts | 2 +- .../api-v1/server-info/server-info.service.ts | 7 +++---- web/src/api/open-api/api.ts | 2 +- web/src/api/open-api/base.ts | 2 +- web/src/api/open-api/common.ts | 2 +- web/src/api/open-api/configuration.ts | 2 +- web/src/api/open-api/index.ts | 2 +- 8 files changed, 9 insertions(+), 10 deletions(-) diff --git a/mobile/openapi/README.md b/mobile/openapi/README.md index 5801f0d8b6263d95ba1c20129cf17ff0248a524e..6aebfa306648a8b9bf8ede11da58a615742d7d86 100644 GIT binary patch delta 14 VcmZ3PwK8kMEM^NmgN<{0OaL#v1^55} delta 14 VcmZ3PwK8kMEM{{((); const getUsageByUser = (id: string) => tmpMap.get(id) || new UsageByUserDto(id); - userStatsQueryResponse.forEach((r) => { - const usageByUser = getUsageByUser(r.userId); + const usageByUser = getUsageByUser(r.ownerId); usageByUser.photos += r.assetType === 'IMAGE' ? parseInt(r.assetCount) : 0; usageByUser.videos += r.assetType === 'VIDEO' ? parseInt(r.assetCount) : 0; usageByUser.usageRaw += parseInt(r.totalSizeInBytes); @@ -68,7 +67,7 @@ export class ServerInfoService { serverStats.videos += r.assetType === 'VIDEO' ? parseInt(r.assetCount) : 0; serverStats.usageRaw += parseInt(r.totalSizeInBytes); serverStats.usage = asHumanReadable(serverStats.usageRaw); - tmpMap.set(r.userId, usageByUser); + tmpMap.set(r.ownerId, usageByUser); }); serverStats.usageByUser = Array.from(tmpMap.values()); diff --git a/web/src/api/open-api/api.ts b/web/src/api/open-api/api.ts index ad6f206418..dba10a603e 100644 --- a/web/src/api/open-api/api.ts +++ b/web/src/api/open-api/api.ts @@ -4,7 +4,7 @@ * Immich * Immich API * - * The version of the OpenAPI document: 1.47.3 + * The version of the OpenAPI document: 1.48.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/web/src/api/open-api/base.ts b/web/src/api/open-api/base.ts index 65aa2e2841..2cfb355b1e 100644 --- a/web/src/api/open-api/base.ts +++ b/web/src/api/open-api/base.ts @@ -4,7 +4,7 @@ * Immich * Immich API * - * The version of the OpenAPI document: 1.47.3 + * The version of the OpenAPI document: 1.48.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/web/src/api/open-api/common.ts b/web/src/api/open-api/common.ts index 8d73891c26..aa11231c0e 100644 --- a/web/src/api/open-api/common.ts +++ b/web/src/api/open-api/common.ts @@ -4,7 +4,7 @@ * Immich * Immich API * - * The version of the OpenAPI document: 1.47.3 + * The version of the OpenAPI document: 1.48.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/web/src/api/open-api/configuration.ts b/web/src/api/open-api/configuration.ts index 376741d5b8..517da032bb 100644 --- a/web/src/api/open-api/configuration.ts +++ b/web/src/api/open-api/configuration.ts @@ -4,7 +4,7 @@ * Immich * Immich API * - * The version of the OpenAPI document: 1.47.3 + * The version of the OpenAPI document: 1.48.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/web/src/api/open-api/index.ts b/web/src/api/open-api/index.ts index c05c360ea8..04666208cb 100644 --- a/web/src/api/open-api/index.ts +++ b/web/src/api/open-api/index.ts @@ -4,7 +4,7 @@ * Immich * Immich API * - * The version of the OpenAPI document: 1.47.3 + * The version of the OpenAPI document: 1.48.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).