Skip to content

Commit df0b536

Browse files
committed
chore: clean up
1 parent a30cae4 commit df0b536

File tree

9 files changed

+75
-25
lines changed

9 files changed

+75
-25
lines changed

docs/docs/overview/comparison.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Comparison
6+
7+
If you're new here and came from other asset self-hosting alternatives you might want to look at a comparison between Immich and your current solution.
8+
Here you can see a [comparison between the various OpenSource Photo Libraries](https://meichthys.github.io/foss_photo_libraries/) including Immich.

e2e/src/api/specs/person.e2e-spec.ts

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { LoginResponseDto, PersonResponseDto } from '@immich/sdk';
1+
import { getPerson, LoginResponseDto, PersonResponseDto } from '@immich/sdk';
22
import { uuidDto } from 'src/fixtures';
33
import { errorDto } from 'src/responses';
4-
import { app, utils } from 'src/utils';
4+
import { app, asBearerAuth, utils } from 'src/utils';
55
import request from 'supertest';
66
import { beforeAll, beforeEach, describe, expect, it } from 'vitest';
77

@@ -203,6 +203,22 @@ describe('/people', () => {
203203
birthDate: '1990-01-01T00:00:00.000Z',
204204
});
205205
});
206+
207+
it('should create a favorite person', async () => {
208+
const { status, body } = await request(app)
209+
.post(`/people`)
210+
.set('Authorization', `Bearer ${admin.accessToken}`)
211+
.send({
212+
name: 'New Favorite Person',
213+
isFavorite: true,
214+
});
215+
expect(status).toBe(201);
216+
expect(body).toMatchObject({
217+
id: expect.any(String),
218+
name: 'New Favorite Person',
219+
isFavorite: true,
220+
});
221+
});
206222
});
207223

208224
describe('PUT /people/:id', () => {
@@ -216,6 +232,7 @@ describe('/people', () => {
216232
{ key: 'name', type: 'string' },
217233
{ key: 'featureFaceAssetId', type: 'string' },
218234
{ key: 'isHidden', type: 'boolean value' },
235+
{ key: 'isFavorite', type: 'boolean value' },
219236
]) {
220237
it(`should not allow null ${key}`, async () => {
221238
const { status, body } = await request(app)
@@ -255,6 +272,24 @@ describe('/people', () => {
255272
expect(status).toBe(200);
256273
expect(body).toMatchObject({ birthDate: null });
257274
});
275+
276+
it('should mark a person as favorite', async () => {
277+
const person = await utils.createPerson(admin.accessToken, {
278+
name: 'visible_person',
279+
});
280+
281+
expect(person.isFavorite).toBe(false);
282+
283+
const { status, body } = await request(app)
284+
.put(`/people/${person.id}`)
285+
.set('Authorization', `Bearer ${admin.accessToken}`)
286+
.send({ isFavorite: true });
287+
expect(status).toBe(200);
288+
expect(body).toMatchObject({ isFavorite: true });
289+
290+
const person2 = await getPerson({ id: person.id }, { headers: asBearerAuth(admin.accessToken) });
291+
expect(person2).toMatchObject({ id: person.id, isFavorite: true });
292+
});
258293
});
259294

260295
describe('POST /people/:id/merge', () => {

mobile/lib/services/folder.service.dart

Whitespace-only changes.

mobile/openapi/lib/model/person_response_dto.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mobile/openapi/lib/model/person_with_faces_response_dto.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

open-api/immich-openapi-specs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10427,7 +10427,7 @@
1042710427
"type": "string"
1042810428
},
1042910429
"isFavorite": {
10430-
"description": "This property was added in v1.124.0",
10430+
"description": "This property was added in v1.126.0",
1043110431
"type": "boolean"
1043210432
},
1043310433
"isHidden": {
@@ -10508,7 +10508,7 @@
1050810508
"type": "string"
1050910509
},
1051010510
"isFavorite": {
10511-
"description": "This property was added in v1.124.0",
10511+
"description": "This property was added in v1.126.0",
1051210512
"type": "boolean"
1051310513
},
1051410514
"isHidden": {

open-api/typescript-sdk/src/fetch-client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export type PersonWithFacesResponseDto = {
215215
birthDate: string | null;
216216
faces: AssetFaceWithoutPersonResponseDto[];
217217
id: string;
218-
/** This property was added in v1.124.0 */
218+
/** This property was added in v1.126.0 */
219219
isFavorite?: boolean;
220220
isHidden: boolean;
221221
name: string;
@@ -494,7 +494,7 @@ export type DuplicateResponseDto = {
494494
export type PersonResponseDto = {
495495
birthDate: string | null;
496496
id: string;
497-
/** This property was added in v1.124.0 */
497+
/** This property was added in v1.126.0 */
498498
isFavorite?: boolean;
499499
isHidden: boolean;
500500
name: string;

server/src/db.d.ts

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@
33
* Please do not edit it manually.
44
*/
55

6-
import type { ColumnType } from 'kysely';
6+
import type { ColumnType } from "kysely";
77

8-
export type ArrayType<T> = ArrayTypeImpl<T> extends (infer U)[] ? U[] : ArrayTypeImpl<T>;
8+
export type ArrayType<T> = ArrayTypeImpl<T> extends (infer U)[]
9+
? U[]
10+
: ArrayTypeImpl<T>;
911

10-
export type ArrayTypeImpl<T> = T extends ColumnType<infer S, infer I, infer U> ? ColumnType<S[], I[], U[]> : T[];
12+
export type ArrayTypeImpl<T> = T extends ColumnType<infer S, infer I, infer U>
13+
? ColumnType<S[], I[], U[]>
14+
: T[];
1115

12-
export type AssetsStatusEnum = 'active' | 'deleted' | 'trashed';
16+
export type AssetsStatusEnum = "active" | "deleted" | "trashed";
1317

14-
export type Generated<T> =
15-
T extends ColumnType<infer S, infer I, infer U> ? ColumnType<S, I | undefined, U> : ColumnType<T, T | undefined, T>;
18+
export type Generated<T> = T extends ColumnType<infer S, infer I, infer U>
19+
? ColumnType<S, I | undefined, U>
20+
: ColumnType<T, T | undefined, T>;
1621

1722
export type Int8 = ColumnType<string, bigint | number | string, bigint | number | string>;
1823

@@ -28,7 +33,7 @@ export type JsonPrimitive = boolean | number | string | null;
2833

2934
export type JsonValue = JsonArray | JsonObject | JsonPrimitive;
3035

31-
export type Sourcetype = 'exif' | 'machine-learning';
36+
export type Sourcetype = "exif" | "machine-learning";
3237

3338
export type Timestamp = ColumnType<Date, Date | string, Date | string>;
3439

@@ -323,11 +328,6 @@ export interface SocketIoAttachments {
323328
payload: Buffer | null;
324329
}
325330

326-
export interface SystemConfig {
327-
key: string;
328-
value: string | null;
329-
}
330-
331331
export interface SystemMetadata {
332332
key: string;
333333
value: Json;
@@ -353,6 +353,15 @@ export interface TagsClosure {
353353
id_descendant: string;
354354
}
355355

356+
export interface TypeormMetadata {
357+
database: string | null;
358+
name: string | null;
359+
schema: string | null;
360+
table: string | null;
361+
type: string;
362+
value: string | null;
363+
}
364+
356365
export interface UserMetadata {
357366
key: string;
358367
userId: string;
@@ -427,13 +436,13 @@ export interface DB {
427436
shared_links: SharedLinks;
428437
smart_search: SmartSearch;
429438
socket_io_attachments: SocketIoAttachments;
430-
system_config: SystemConfig;
431439
system_metadata: SystemMetadata;
432440
tag_asset: TagAsset;
433441
tags: Tags;
434442
tags_closure: TagsClosure;
443+
typeorm_metadata: TypeormMetadata;
435444
user_metadata: UserMetadata;
436445
users: Users;
437-
'vectors.pg_vector_index_stat': VectorsPgVectorIndexStat;
446+
"vectors.pg_vector_index_stat": VectorsPgVectorIndexStat;
438447
version_history: VersionHistory;
439448
}

server/src/dtos/person.dto.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export class PersonCreateDto {
3333
@ValidateBoolean({ optional: true })
3434
isHidden?: boolean;
3535

36-
@ApiProperty()
3736
@ValidateBoolean({ optional: true })
3837
isFavorite?: boolean;
3938
}
@@ -101,8 +100,7 @@ export class PersonResponseDto {
101100
isHidden!: boolean;
102101
@PropertyLifecycle({ addedAt: 'v1.107.0' })
103102
updatedAt?: Date;
104-
@ApiProperty()
105-
@PropertyLifecycle({ addedAt: 'v1.124.0' })
103+
@PropertyLifecycle({ addedAt: 'v1.126.0' })
106104
isFavorite?: boolean;
107105
}
108106

0 commit comments

Comments
 (0)