From 1338c5fd593f4f861373853dc86fb2367c02d670 Mon Sep 17 00:00:00 2001 From: mertalev <101130780+mertalev@users.noreply.github.com> Date: Sun, 3 Dec 2023 19:23:21 -0500 Subject: [PATCH] formatting --- .github/workflows/test.yml | 2 +- mobile/openapi/doc/SearchApi.md | 24 +----- mobile/openapi/lib/api/search_api.dart | 76 +--------------- mobile/openapi/test/search_api_test.dart | 2 +- server/immich-openapi-specs.json | 86 ------------------- .../asset/response-dto/asset-response.dto.ts | 2 +- server/src/domain/job/job.service.spec.ts | 6 +- .../domain/repositories/asset.repository.ts | 2 +- .../repositories/smart-info.repository.ts | 2 +- server/src/domain/search/dto/search.dto.ts | 17 +++- server/src/domain/search/search.service.ts | 2 +- server/src/infra/database-locks.ts | 12 +-- server/src/infra/index.ts | 2 +- server/src/infra/infra.module.ts | 2 +- server/src/infra/infra.utils.ts | 4 +- .../infra/repositories/metadata.repository.ts | 2 +- .../repositories/smart-info.repository.ts | 25 +++--- server/test/e2e/person.e2e-spec.ts | 12 ++- server/test/e2e/search.e2e-spec.ts | 12 ++- 19 files changed, 75 insertions(+), 217 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ae2f0ef61..d1fb602dd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -213,7 +213,7 @@ jobs: runs-on: ubuntu-latest services: postgres: - image: tensorchord/pgvecto-rs:pg14-v0.1.10 + image: tensorchord/pgvecto-rs:pg14-v0.1.11 env: POSTGRES_PASSWORD: postgres POSTGRES_USER: postgres diff --git a/mobile/openapi/doc/SearchApi.md b/mobile/openapi/doc/SearchApi.md index b5c6c9de8..d70cfd75e 100644 --- a/mobile/openapi/doc/SearchApi.md +++ b/mobile/openapi/doc/SearchApi.md @@ -66,7 +66,7 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **search** -> SearchResponseDto search(q, query, clip, type, isFavorite, isArchived, exifInfoPeriodCity, exifInfoPeriodState, exifInfoPeriodCountry, exifInfoPeriodMake, exifInfoPeriodModel, exifInfoPeriodProjectionType, smartInfoPeriodObjects, smartInfoPeriodTags, recent, motion) +> SearchResponseDto search(q, query, clip, type, recent, motion) @@ -93,21 +93,11 @@ final q = q_example; // String | final query = query_example; // String | final clip = true; // bool | final type = type_example; // String | -final isFavorite = true; // bool | -final isArchived = true; // bool | -final exifInfoPeriodCity = exifInfoPeriodCity_example; // String | -final exifInfoPeriodState = exifInfoPeriodState_example; // String | -final exifInfoPeriodCountry = exifInfoPeriodCountry_example; // String | -final exifInfoPeriodMake = exifInfoPeriodMake_example; // String | -final exifInfoPeriodModel = exifInfoPeriodModel_example; // String | -final exifInfoPeriodProjectionType = exifInfoPeriodProjectionType_example; // String | -final smartInfoPeriodObjects = []; // List | -final smartInfoPeriodTags = []; // List | final recent = true; // bool | final motion = true; // bool | try { - final result = api_instance.search(q, query, clip, type, isFavorite, isArchived, exifInfoPeriodCity, exifInfoPeriodState, exifInfoPeriodCountry, exifInfoPeriodMake, exifInfoPeriodModel, exifInfoPeriodProjectionType, smartInfoPeriodObjects, smartInfoPeriodTags, recent, motion); + final result = api_instance.search(q, query, clip, type, recent, motion); print(result); } catch (e) { print('Exception when calling SearchApi->search: $e\n'); @@ -122,16 +112,6 @@ Name | Type | Description | Notes **query** | **String**| | [optional] **clip** | **bool**| | [optional] **type** | **String**| | [optional] - **isFavorite** | **bool**| | [optional] - **isArchived** | **bool**| | [optional] - **exifInfoPeriodCity** | **String**| | [optional] - **exifInfoPeriodState** | **String**| | [optional] - **exifInfoPeriodCountry** | **String**| | [optional] - **exifInfoPeriodMake** | **String**| | [optional] - **exifInfoPeriodModel** | **String**| | [optional] - **exifInfoPeriodProjectionType** | **String**| | [optional] - **smartInfoPeriodObjects** | [**List**](String.md)| | [optional] [default to const []] - **smartInfoPeriodTags** | [**List**](String.md)| | [optional] [default to const []] **recent** | **bool**| | [optional] **motion** | **bool**| | [optional] diff --git a/mobile/openapi/lib/api/search_api.dart b/mobile/openapi/lib/api/search_api.dart index 7c01d5e9b..c1b6a51f8 100644 --- a/mobile/openapi/lib/api/search_api.dart +++ b/mobile/openapi/lib/api/search_api.dart @@ -71,30 +71,10 @@ class SearchApi { /// /// * [String] type: /// - /// * [bool] isFavorite: - /// - /// * [bool] isArchived: - /// - /// * [String] exifInfoPeriodCity: - /// - /// * [String] exifInfoPeriodState: - /// - /// * [String] exifInfoPeriodCountry: - /// - /// * [String] exifInfoPeriodMake: - /// - /// * [String] exifInfoPeriodModel: - /// - /// * [String] exifInfoPeriodProjectionType: - /// - /// * [List] smartInfoPeriodObjects: - /// - /// * [List] smartInfoPeriodTags: - /// /// * [bool] recent: /// /// * [bool] motion: - Future searchWithHttpInfo({ String? q, String? query, bool? clip, String? type, bool? isFavorite, bool? isArchived, String? exifInfoPeriodCity, String? exifInfoPeriodState, String? exifInfoPeriodCountry, String? exifInfoPeriodMake, String? exifInfoPeriodModel, String? exifInfoPeriodProjectionType, List? smartInfoPeriodObjects, List? smartInfoPeriodTags, bool? recent, bool? motion, }) async { + Future searchWithHttpInfo({ String? q, String? query, bool? clip, String? type, bool? recent, bool? motion, }) async { // ignore: prefer_const_declarations final path = r'/search'; @@ -117,36 +97,6 @@ class SearchApi { if (type != null) { queryParams.addAll(_queryParams('', 'type', type)); } - if (isFavorite != null) { - queryParams.addAll(_queryParams('', 'isFavorite', isFavorite)); - } - if (isArchived != null) { - queryParams.addAll(_queryParams('', 'isArchived', isArchived)); - } - if (exifInfoPeriodCity != null) { - queryParams.addAll(_queryParams('', 'exifInfo.city', exifInfoPeriodCity)); - } - if (exifInfoPeriodState != null) { - queryParams.addAll(_queryParams('', 'exifInfo.state', exifInfoPeriodState)); - } - if (exifInfoPeriodCountry != null) { - queryParams.addAll(_queryParams('', 'exifInfo.country', exifInfoPeriodCountry)); - } - if (exifInfoPeriodMake != null) { - queryParams.addAll(_queryParams('', 'exifInfo.make', exifInfoPeriodMake)); - } - if (exifInfoPeriodModel != null) { - queryParams.addAll(_queryParams('', 'exifInfo.model', exifInfoPeriodModel)); - } - if (exifInfoPeriodProjectionType != null) { - queryParams.addAll(_queryParams('', 'exifInfo.projectionType', exifInfoPeriodProjectionType)); - } - if (smartInfoPeriodObjects != null) { - queryParams.addAll(_queryParams('multi', 'smartInfo.objects', smartInfoPeriodObjects)); - } - if (smartInfoPeriodTags != null) { - queryParams.addAll(_queryParams('multi', 'smartInfo.tags', smartInfoPeriodTags)); - } if (recent != null) { queryParams.addAll(_queryParams('', 'recent', recent)); } @@ -178,31 +128,11 @@ class SearchApi { /// /// * [String] type: /// - /// * [bool] isFavorite: - /// - /// * [bool] isArchived: - /// - /// * [String] exifInfoPeriodCity: - /// - /// * [String] exifInfoPeriodState: - /// - /// * [String] exifInfoPeriodCountry: - /// - /// * [String] exifInfoPeriodMake: - /// - /// * [String] exifInfoPeriodModel: - /// - /// * [String] exifInfoPeriodProjectionType: - /// - /// * [List] smartInfoPeriodObjects: - /// - /// * [List] smartInfoPeriodTags: - /// /// * [bool] recent: /// /// * [bool] motion: - Future search({ String? q, String? query, bool? clip, String? type, bool? isFavorite, bool? isArchived, String? exifInfoPeriodCity, String? exifInfoPeriodState, String? exifInfoPeriodCountry, String? exifInfoPeriodMake, String? exifInfoPeriodModel, String? exifInfoPeriodProjectionType, List? smartInfoPeriodObjects, List? smartInfoPeriodTags, bool? recent, bool? motion, }) async { - final response = await searchWithHttpInfo( q: q, query: query, clip: clip, type: type, isFavorite: isFavorite, isArchived: isArchived, exifInfoPeriodCity: exifInfoPeriodCity, exifInfoPeriodState: exifInfoPeriodState, exifInfoPeriodCountry: exifInfoPeriodCountry, exifInfoPeriodMake: exifInfoPeriodMake, exifInfoPeriodModel: exifInfoPeriodModel, exifInfoPeriodProjectionType: exifInfoPeriodProjectionType, smartInfoPeriodObjects: smartInfoPeriodObjects, smartInfoPeriodTags: smartInfoPeriodTags, recent: recent, motion: motion, ); + Future search({ String? q, String? query, bool? clip, String? type, bool? recent, bool? motion, }) async { + final response = await searchWithHttpInfo( q: q, query: query, clip: clip, type: type, recent: recent, motion: motion, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } diff --git a/mobile/openapi/test/search_api_test.dart b/mobile/openapi/test/search_api_test.dart index a2fba73e7..09788ee44 100644 --- a/mobile/openapi/test/search_api_test.dart +++ b/mobile/openapi/test/search_api_test.dart @@ -22,7 +22,7 @@ void main() { // TODO }); - //Future search({ String q, String query, bool clip, String type, bool isFavorite, bool isArchived, String exifInfoPeriodCity, String exifInfoPeriodState, String exifInfoPeriodCountry, String exifInfoPeriodMake, String exifInfoPeriodModel, String exifInfoPeriodProjectionType, List smartInfoPeriodObjects, List smartInfoPeriodTags, bool recent, bool motion }) async + //Future search({ String q, String query, bool clip, String type, bool recent, bool motion }) async test('test search', () async { // TODO }); diff --git a/server/immich-openapi-specs.json b/server/immich-openapi-specs.json index d6355e894..3e451ba68 100644 --- a/server/immich-openapi-specs.json +++ b/server/immich-openapi-specs.json @@ -4567,92 +4567,6 @@ "type": "string" } }, - { - "name": "isFavorite", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isArchived", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "exifInfo.city", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "exifInfo.state", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "exifInfo.country", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "exifInfo.make", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "exifInfo.model", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "exifInfo.projectionType", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "smartInfo.objects", - "required": false, - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "smartInfo.tags", - "required": false, - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, { "name": "recent", "required": false, diff --git a/server/src/domain/asset/response-dto/asset-response.dto.ts b/server/src/domain/asset/response-dto/asset-response.dto.ts index c3a7491cf..45b86b282 100644 --- a/server/src/domain/asset/response-dto/asset-response.dto.ts +++ b/server/src/domain/asset/response-dto/asset-response.dto.ts @@ -1,4 +1,4 @@ -import { AssetEntity, AssetFaceEntity, AssetType } from '@app/infra/entities'; +import { AssetEntity, AssetType } from '@app/infra/entities'; import { ApiProperty } from '@nestjs/swagger'; import { PersonWithFacesResponseDto } from '../../person/person.dto'; import { TagResponseDto, mapTag } from '../../tag'; diff --git a/server/src/domain/job/job.service.spec.ts b/server/src/domain/job/job.service.spec.ts index 4c7270022..859bc39f0 100644 --- a/server/src/domain/job/job.service.spec.ts +++ b/server/src/domain/job/job.service.spec.ts @@ -1,4 +1,4 @@ -import { SystemConfig, SystemConfigEntity, SystemConfigKey } from '@app/infra/entities'; +import { SystemConfig, SystemConfigKey } from '@app/infra/entities'; import { BadRequestException } from '@nestjs/common'; import { assetStub, @@ -362,7 +362,7 @@ describe(JobService.name, () => { }); } - const featureTests: Array<{ queue: QueueName, feature: FeatureFlag, configKey: SystemConfigKey}> = [ + const featureTests: Array<{ queue: QueueName; feature: FeatureFlag; configKey: SystemConfigKey }> = [ { queue: QueueName.CLIP_ENCODING, feature: FeatureFlag.CLIP_ENCODE, @@ -385,7 +385,7 @@ describe(JobService.name, () => { configMock.load.mockResolvedValue([{ key: configKey, value: false }]); jobMock.getQueueStatus.mockResolvedValue({ isActive: false, isPaused: false }); - expect(sut.handleCommand(queue, { command: JobCommand.START, force: false })).rejects.toThrow(); + await expect(sut.handleCommand(queue, { command: JobCommand.START, force: false })).rejects.toThrow(); }); } }); diff --git a/server/src/domain/repositories/asset.repository.ts b/server/src/domain/repositories/asset.repository.ts index 96d615416..48f83de37 100644 --- a/server/src/domain/repositories/asset.repository.ts +++ b/server/src/domain/repositories/asset.repository.ts @@ -1,5 +1,5 @@ import { SearchExploreItem } from '@app/domain'; -import { AssetEntity, AssetJobStatusEntity, AssetType, ExifEntity, SmartInfoEntity } from '@app/infra/entities'; +import { AssetEntity, AssetJobStatusEntity, AssetType, ExifEntity } from '@app/infra/entities'; import { FindOptionsRelations } from 'typeorm'; import { Paginated, PaginationOptions } from '../domain.util'; diff --git a/server/src/domain/repositories/smart-info.repository.ts b/server/src/domain/repositories/smart-info.repository.ts index 3c65ce776..c41cdd7f6 100644 --- a/server/src/domain/repositories/smart-info.repository.ts +++ b/server/src/domain/repositories/smart-info.repository.ts @@ -2,7 +2,7 @@ import { AssetEntity, AssetFaceEntity, SmartInfoEntity } from '@app/infra/entiti export const ISmartInfoRepository = 'ISmartInfoRepository'; -export type Embedding = number[]; +export type Embedding = number[]; export interface EmbeddingSearch { ownerId: string; diff --git a/server/src/domain/search/dto/search.dto.ts b/server/src/domain/search/dto/search.dto.ts index f84e8021d..3a77bd4b7 100644 --- a/server/src/domain/search/dto/search.dto.ts +++ b/server/src/domain/search/dto/search.dto.ts @@ -1,5 +1,6 @@ +import { AssetType } from '@app/infra/entities'; import { Transform } from 'class-transformer'; -import { IsBoolean, IsNotEmpty, IsString } from 'class-validator'; +import { IsBoolean, IsEnum, IsNotEmpty, IsString } from 'class-validator'; import { Optional, toBoolean } from '../../domain.util'; export class SearchDto { @@ -17,6 +18,20 @@ export class SearchDto { @Optional() @Transform(toBoolean) clip?: boolean; + + @IsEnum(AssetType) + @Optional() + type?: AssetType; + + @IsBoolean() + @Optional() + @Transform(toBoolean) + recent?: boolean; + + @IsBoolean() + @Optional() + @Transform(toBoolean) + motion?: boolean; } export class SearchPeopleDto { diff --git a/server/src/domain/search/search.service.ts b/server/src/domain/search/search.service.ts index fea4a3fcc..3347909fc 100644 --- a/server/src/domain/search/search.service.ts +++ b/server/src/domain/search/search.service.ts @@ -80,7 +80,7 @@ export class SearchService { default: break; } - + return { albums: { total: 0, diff --git a/server/src/infra/database-locks.ts b/server/src/infra/database-locks.ts index e023f76b5..f46027316 100644 --- a/server/src/infra/database-locks.ts +++ b/server/src/infra/database-locks.ts @@ -2,7 +2,7 @@ import { dataSource } from '@app/infra'; import AsyncLock from 'async-lock'; export enum DatabaseLock { GeodataImport = 100, - CLIPDimSize = 512 + CLIPDimSize = 512, } export async function acquireLock(lock: DatabaseLock): Promise { @@ -15,10 +15,12 @@ export async function releaseLock(lock: DatabaseLock): Promise { export const asyncLock = new AsyncLock(); -export function RequireLock(lock: DatabaseLock): Function { +export function RequireLock( + lock: DatabaseLock, +): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void { return function (target: any, propertyKey: string, descriptor: PropertyDescriptor): void { const originalMethod = descriptor.value; - descriptor.value = async function(...args: any[]): Promise { + descriptor.value = async function (...args: any[]): Promise { if (!dataSource.isInitialized) { await dataSource.initialize(); } @@ -35,5 +37,5 @@ export function RequireLock(lock: DatabaseLock): Function { return res as any; }; - } -} \ No newline at end of file + }; +} diff --git a/server/src/infra/index.ts b/server/src/infra/index.ts index 592808c65..c3b1a4377 100644 --- a/server/src/infra/index.ts +++ b/server/src/infra/index.ts @@ -1,5 +1,5 @@ -export * from './database.config'; export * from './database-locks'; +export * from './database.config'; export * from './infra.config'; export * from './infra.module'; export * from './redis-io.adapter'; diff --git a/server/src/infra/infra.module.ts b/server/src/infra/infra.module.ts index 3d07f1f26..47c274aa8 100644 --- a/server/src/infra/infra.module.ts +++ b/server/src/infra/infra.module.ts @@ -53,8 +53,8 @@ import { MoveRepository, PartnerRepository, PersonRepository, - ServerInfoRepository, SearchRepository, + ServerInfoRepository, SharedLinkRepository, SmartInfoRepository, SystemConfigRepository, diff --git a/server/src/infra/infra.utils.ts b/server/src/infra/infra.utils.ts index 77f70e91f..6956b2fbd 100644 --- a/server/src/infra/infra.utils.ts +++ b/server/src/infra/infra.utils.ts @@ -36,7 +36,7 @@ export async function paginate( export const asVector = (embedding: number[], quote = false) => quote ? `'[${embedding.join(',')}]'` : `[${embedding.join(',')}]`; -export const isValidInteger = (value: number, options: {min?: number, max?: number}): value is number => { +export const isValidInteger = (value: number, options: { min?: number; max?: number }): value is number => { const { min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER } = options; return Number.isInteger(value) && value >= min && value <= max; -} +}; diff --git a/server/src/infra/repositories/metadata.repository.ts b/server/src/infra/repositories/metadata.repository.ts index 26f24fbf0..15ccabd0c 100644 --- a/server/src/infra/repositories/metadata.repository.ts +++ b/server/src/infra/repositories/metadata.repository.ts @@ -5,8 +5,8 @@ import { ISystemMetadataRepository, ReverseGeocodeResult, } from '@app/domain'; -import { GeodataAdmin1Entity, GeodataAdmin2Entity, GeodataPlacesEntity, SystemMetadataKey } from '@app/infra/entities'; import { DatabaseLock, RequireLock } from '@app/infra'; +import { GeodataAdmin1Entity, GeodataAdmin2Entity, GeodataPlacesEntity, SystemMetadataKey } from '@app/infra/entities'; import { Inject, Logger } from '@nestjs/common'; import { InjectDataSource, InjectRepository } from '@nestjs/typeorm'; import { DefaultReadTaskOptions, exiftool, Tags } from 'exiftool-vendored'; diff --git a/server/src/infra/repositories/smart-info.repository.ts b/server/src/infra/repositories/smart-info.repository.ts index 477856e5e..d8df4054e 100644 --- a/server/src/infra/repositories/smart-info.repository.ts +++ b/server/src/infra/repositories/smart-info.repository.ts @@ -1,10 +1,10 @@ import { Embedding, EmbeddingSearch, ISmartInfoRepository } from '@app/domain'; +import { DatabaseLock, RequireLock, asyncLock } from '@app/infra'; +import { AssetEntity, AssetFaceEntity, SmartInfoEntity, SmartSearchEntity } from '@app/infra/entities'; import { Injectable, Logger } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; -import { AssetEntity, AssetFaceEntity, SmartInfoEntity, SmartSearchEntity } from '@app/infra/entities'; import { asVector, isValidInteger } from '../infra.utils'; -import { DatabaseLock, RequireLock, asyncLock } from '@app/infra'; @Injectable() export class SmartInfoRepository implements ISmartInfoRepository { @@ -46,12 +46,7 @@ export class SmartInfoRepository implements ISmartInfoRepository { return results; } - async searchFaces({ - ownerId, - embedding, - numResults, - maxDistance, - }: EmbeddingSearch): Promise { + async searchFaces({ ownerId, embedding, numResults, maxDistance }: EmbeddingSearch): Promise { if (!isValidInteger(numResults, { min: 1 })) { throw new Error(`Invalid value for 'numResults': ${numResults}`); } @@ -84,7 +79,9 @@ export class SmartInfoRepository implements ISmartInfoRepository { async upsert(smartInfo: Partial, embedding?: Embedding): Promise { await this.repository.upsert(smartInfo, { conflictPaths: ['assetId'] }); - if (!smartInfo.assetId || !embedding) return; + if (!smartInfo.assetId || !embedding) { + return; + } await this.upsertEmbedding(smartInfo.assetId, embedding); } @@ -115,8 +112,10 @@ export class SmartInfoRepository implements ISmartInfoRepository { throw new Error(`Invalid CLIP dimension size: ${dimSize}`); } - if (this.curDimSize === dimSize) return; - + if (this.curDimSize === dimSize) { + return; + } + this.logger.log(`Current dimension size is ${this.curDimSize}. Updating CLIP dimension size to ${dimSize}.`); await this.smartSearchRepository.manager.transaction(async (manager) => { @@ -142,7 +141,9 @@ export class SmartInfoRepository implements ISmartInfoRepository { @RequireLock(DatabaseLock.CLIPDimSize) private async getDimSize(): Promise { - if (this.curDimSize != null) return; + if (this.curDimSize != null) { + return; + } const res = await this.smartSearchRepository.manager.query(` SELECT atttypmod as dimsize diff --git a/server/test/e2e/person.e2e-spec.ts b/server/test/e2e/person.e2e-spec.ts index 30b1de9ed..82903ce63 100644 --- a/server/test/e2e/person.e2e-spec.ts +++ b/server/test/e2e/person.e2e-spec.ts @@ -37,7 +37,11 @@ describe(`${PersonController.name}`, () => { name: 'visible_person', thumbnailPath: '/thumbnail/face_asset', }); - await personRepository.createFace({ assetId: faceAsset.id, personId: visiblePerson.id, embedding: Array.from({length: 512}, Math.random) }); + await personRepository.createFace({ + assetId: faceAsset.id, + personId: visiblePerson.id, + embedding: Array.from({ length: 512 }, Math.random), + }); hiddenPerson = await personRepository.create({ ownerId: loginResponse.userId, @@ -45,7 +49,11 @@ describe(`${PersonController.name}`, () => { isHidden: true, thumbnailPath: '/thumbnail/face_asset', }); - await personRepository.createFace({ assetId: faceAsset.id, personId: hiddenPerson.id, embedding: Array.from({length: 512}, Math.random) }); + await personRepository.createFace({ + assetId: faceAsset.id, + personId: hiddenPerson.id, + embedding: Array.from({ length: 512 }, Math.random), + }); }); describe('GET /person', () => { diff --git a/server/test/e2e/search.e2e-spec.ts b/server/test/e2e/search.e2e-spec.ts index d0524d2db..7ab95776c 100644 --- a/server/test/e2e/search.e2e-spec.ts +++ b/server/test/e2e/search.e2e-spec.ts @@ -1,4 +1,11 @@ -import { AssetResponseDto, IAssetRepository, ISmartInfoRepository, LibraryResponseDto, LoginResponseDto, mapAsset } from '@app/domain'; +import { + AssetResponseDto, + IAssetRepository, + ISmartInfoRepository, + LibraryResponseDto, + LoginResponseDto, + mapAsset, +} from '@app/domain'; import { SearchController } from '@app/immich'; import { INestApplication } from '@nestjs/common'; import { api } from '@test/api'; @@ -47,7 +54,8 @@ describe(`${SearchController.name}`, () => { }); await smartInfoRepository.upsert( { assetId, objects: ['car', 'tree'], tags: ['accident'] }, - Array.from({ length: 512 }, Math.random)); + Array.from({ length: 512 }, Math.random), + ); const assetWithMetadata = await assetRepository.getById(assetId, { exifInfo: true, smartInfo: true }); if (!assetWithMetadata) { throw new Error('Asset not found');