Skip to content

Commit dffe1b5

Browse files
jrasm91yosit
authored andcommitted
refactor: remove smart info table (immich-app#13985)
1 parent d1aaeb6 commit dffe1b5

25 files changed

+16
-345
lines changed

Diff for: e2e/src/api/specs/search.e2e-spec.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,7 @@ describe('/search', () => {
473473
.get('/search/explore')
474474
.set('Authorization', `Bearer ${admin.accessToken}`);
475475
expect(status).toBe(200);
476-
expect(body).toEqual([
477-
{ fieldName: 'exifInfo.city', items: [] },
478-
{ fieldName: 'smartInfo.tags', items: [] },
479-
]);
476+
expect(body).toEqual([{ fieldName: 'exifInfo.city', items: [] }]);
480477
});
481478
});
482479

Diff for: mobile/openapi/README.md

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: mobile/openapi/lib/api.dart

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: mobile/openapi/lib/api_client.dart

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: mobile/openapi/lib/model/asset_response_dto.dart

+1-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: mobile/openapi/lib/model/smart_info_response_dto.dart

-117
This file was deleted.

Diff for: open-api/immich-openapi-specs.json

-22
Original file line numberDiff line numberDiff line change
@@ -8402,9 +8402,6 @@
84028402
"description": "This property was deprecated in v1.113.0",
84038403
"type": "boolean"
84048404
},
8405-
"smartInfo": {
8406-
"$ref": "#/components/schemas/SmartInfoResponseDto"
8407-
},
84088405
"stack": {
84098406
"allOf": [
84108407
{
@@ -11284,25 +11281,6 @@
1128411281
],
1128511282
"type": "object"
1128611283
},
11287-
"SmartInfoResponseDto": {
11288-
"properties": {
11289-
"objects": {
11290-
"items": {
11291-
"type": "string"
11292-
},
11293-
"nullable": true,
11294-
"type": "array"
11295-
},
11296-
"tags": {
11297-
"items": {
11298-
"type": "string"
11299-
},
11300-
"nullable": true,
11301-
"type": "array"
11302-
}
11303-
},
11304-
"type": "object"
11305-
},
1130611284
"SmartSearchDto": {
1130711285
"properties": {
1130811286
"city": {

Diff for: open-api/typescript-sdk/src/fetch-client.ts

-5
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,6 @@ export type PersonWithFacesResponseDto = {
221221
/** This property was added in v1.107.0 */
222222
updatedAt?: string;
223223
};
224-
export type SmartInfoResponseDto = {
225-
objects?: string[] | null;
226-
tags?: string[] | null;
227-
};
228224
export type AssetStackResponseDto = {
229225
assetCount: number;
230226
id: string;
@@ -267,7 +263,6 @@ export type AssetResponseDto = {
267263
people?: PersonWithFacesResponseDto[];
268264
/** This property was deprecated in v1.113.0 */
269265
resized?: boolean;
270-
smartInfo?: SmartInfoResponseDto;
271266
stack?: (AssetStackResponseDto) | null;
272267
tags?: TagResponseDto[];
273268
thumbhash: string | null;

Diff for: server/src/dtos/asset-response.dto.ts

-15
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { TagResponseDto, mapTag } from 'src/dtos/tag.dto';
1212
import { UserResponseDto, mapUser } from 'src/dtos/user.dto';
1313
import { AssetFaceEntity } from 'src/entities/asset-face.entity';
1414
import { AssetEntity } from 'src/entities/asset.entity';
15-
import { SmartInfoEntity } from 'src/entities/smart-info.entity';
1615
import { AssetType } from 'src/enum';
1716
import { mimeTypes } from 'src/utils/mime-types';
1817

@@ -45,7 +44,6 @@ export class AssetResponseDto extends SanitizedAssetResponseDto {
4544
isTrashed!: boolean;
4645
isOffline!: boolean;
4746
exifInfo?: ExifResponseDto;
48-
smartInfo?: SmartInfoResponseDto;
4947
tags?: TagResponseDto[];
5048
people?: PersonWithFacesResponseDto[];
5149
unassignedFaces?: AssetFaceWithoutPersonResponseDto[];
@@ -141,7 +139,6 @@ export function mapAsset(entity: AssetEntity, options: AssetMapOptions = {}): As
141139
isTrashed: !!entity.deletedAt,
142140
duration: entity.duration ?? '0:00:00.00000',
143141
exifInfo: entity.exifInfo ? mapExif(entity.exifInfo) : undefined,
144-
smartInfo: entity.smartInfo ? mapSmartInfo(entity.smartInfo) : undefined,
145142
livePhotoVideoId: entity.livePhotoVideoId,
146143
tags: entity.tags?.map((tag) => mapTag(tag)),
147144
people: peopleWithFaces(entity.faces),
@@ -161,15 +158,3 @@ export class MemoryLaneResponseDto {
161158

162159
assets!: AssetResponseDto[];
163160
}
164-
165-
export class SmartInfoResponseDto {
166-
tags?: string[] | null;
167-
objects?: string[] | null;
168-
}
169-
170-
export function mapSmartInfo(entity: SmartInfoEntity): SmartInfoResponseDto {
171-
return {
172-
tags: entity.tags,
173-
objects: entity.objects,
174-
};
175-
}

Diff for: server/src/entities/asset.entity.ts

-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { AssetJobStatusEntity } from 'src/entities/asset-job-status.entity';
55
import { ExifEntity } from 'src/entities/exif.entity';
66
import { LibraryEntity } from 'src/entities/library.entity';
77
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
8-
import { SmartInfoEntity } from 'src/entities/smart-info.entity';
98
import { SmartSearchEntity } from 'src/entities/smart-search.entity';
109
import { StackEntity } from 'src/entities/stack.entity';
1110
import { TagEntity } from 'src/entities/tag.entity';
@@ -143,9 +142,6 @@ export class AssetEntity {
143142
@OneToOne(() => ExifEntity, (exifEntity) => exifEntity.asset)
144143
exifInfo?: ExifEntity;
145144

146-
@OneToOne(() => SmartInfoEntity, (smartInfoEntity) => smartInfoEntity.asset)
147-
smartInfo?: SmartInfoEntity;
148-
149145
@OneToOne(() => SmartSearchEntity, (smartSearchEntity) => smartSearchEntity.asset)
150146
smartSearch?: SmartSearchEntity;
151147

Diff for: server/src/entities/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { PartnerEntity } from 'src/entities/partner.entity';
1818
import { PersonEntity } from 'src/entities/person.entity';
1919
import { SessionEntity } from 'src/entities/session.entity';
2020
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
21-
import { SmartInfoEntity } from 'src/entities/smart-info.entity';
2221
import { SmartSearchEntity } from 'src/entities/smart-search.entity';
2322
import { StackEntity } from 'src/entities/stack.entity';
2423
import { SystemMetadataEntity } from 'src/entities/system-metadata.entity';
@@ -46,7 +45,6 @@ export const entities = [
4645
PartnerEntity,
4746
PersonEntity,
4847
SharedLinkEntity,
49-
SmartInfoEntity,
5048
SmartSearchEntity,
5149
StackEntity,
5250
SystemMetadataEntity,

Diff for: server/src/entities/smart-info.entity.ts

-18
This file was deleted.

Diff for: server/src/interfaces/asset.interface.ts

-4
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ export enum WithoutProperty {
2828
EXIF = 'exif',
2929
SMART_SEARCH = 'smart-search',
3030
DUPLICATE = 'duplicate',
31-
OBJECT_TAGS = 'object-tags',
3231
FACES = 'faces',
33-
PERSON = 'person',
3432
SIDECAR = 'sidecar',
3533
}
3634

@@ -94,7 +92,6 @@ export type AssetWithoutRelations = Omit<
9492
| 'library'
9593
| 'exifInfo'
9694
| 'sharedLinks'
97-
| 'smartInfo'
9895
| 'smartSearch'
9996
| 'tags'
10097
>;
@@ -190,7 +187,6 @@ export interface IAssetRepository {
190187
upsertExif(exif: Partial<ExifEntity>): Promise<void>;
191188
upsertJobStatus(...jobStatus: Partial<AssetJobStatusEntity>[]): Promise<void>;
192189
getAssetIdByCity(userId: string, options: AssetExploreFieldOptions): Promise<SearchExploreItem<string>>;
193-
getAssetIdByTag(userId: string, options: AssetExploreFieldOptions): Promise<SearchExploreItem<string>>;
194190
getDuplicates(options: AssetBuilderOptions): Promise<AssetEntity[]>;
195191
getAllForUserFullSync(options: AssetFullSyncOptions): Promise<AssetEntity[]>;
196192
getChangedDeltaSync(options: AssetDeltaSyncOptions): Promise<AssetEntity[]>;

0 commit comments

Comments
 (0)