Skip to content

Commit

Permalink
refactor: remove smart info table (#13985)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasm91 authored Nov 7, 2024
1 parent 6053214 commit 64831e2
Show file tree
Hide file tree
Showing 25 changed files with 16 additions and 345 deletions.
5 changes: 1 addition & 4 deletions e2e/src/api/specs/search.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,7 @@ describe('/search', () => {
.get('/search/explore')
.set('Authorization', `Bearer ${admin.accessToken}`);
expect(status).toBe(200);
expect(body).toEqual([
{ fieldName: 'exifInfo.city', items: [] },
{ fieldName: 'smartInfo.tags', items: [] },
]);
expect(body).toEqual([{ fieldName: 'exifInfo.city', items: [] }]);
});
});

Expand Down
1 change: 0 additions & 1 deletion mobile/openapi/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion mobile/openapi/lib/api.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions mobile/openapi/lib/api_client.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 1 addition & 18 deletions mobile/openapi/lib/model/asset_response_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

117 changes: 0 additions & 117 deletions mobile/openapi/lib/model/smart_info_response_dto.dart

This file was deleted.

22 changes: 0 additions & 22 deletions open-api/immich-openapi-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -8402,9 +8402,6 @@
"description": "This property was deprecated in v1.113.0",
"type": "boolean"
},
"smartInfo": {
"$ref": "#/components/schemas/SmartInfoResponseDto"
},
"stack": {
"allOf": [
{
Expand Down Expand Up @@ -11284,25 +11281,6 @@
],
"type": "object"
},
"SmartInfoResponseDto": {
"properties": {
"objects": {
"items": {
"type": "string"
},
"nullable": true,
"type": "array"
},
"tags": {
"items": {
"type": "string"
},
"nullable": true,
"type": "array"
}
},
"type": "object"
},
"SmartSearchDto": {
"properties": {
"city": {
Expand Down
5 changes: 0 additions & 5 deletions open-api/typescript-sdk/src/fetch-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,6 @@ export type PersonWithFacesResponseDto = {
/** This property was added in v1.107.0 */
updatedAt?: string;
};
export type SmartInfoResponseDto = {
objects?: string[] | null;
tags?: string[] | null;
};
export type AssetStackResponseDto = {
assetCount: number;
id: string;
Expand Down Expand Up @@ -267,7 +263,6 @@ export type AssetResponseDto = {
people?: PersonWithFacesResponseDto[];
/** This property was deprecated in v1.113.0 */
resized?: boolean;
smartInfo?: SmartInfoResponseDto;
stack?: (AssetStackResponseDto) | null;
tags?: TagResponseDto[];
thumbhash: string | null;
Expand Down
15 changes: 0 additions & 15 deletions server/src/dtos/asset-response.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { TagResponseDto, mapTag } from 'src/dtos/tag.dto';
import { UserResponseDto, mapUser } from 'src/dtos/user.dto';
import { AssetFaceEntity } from 'src/entities/asset-face.entity';
import { AssetEntity } from 'src/entities/asset.entity';
import { SmartInfoEntity } from 'src/entities/smart-info.entity';
import { AssetType } from 'src/enum';
import { mimeTypes } from 'src/utils/mime-types';

Expand Down Expand Up @@ -45,7 +44,6 @@ export class AssetResponseDto extends SanitizedAssetResponseDto {
isTrashed!: boolean;
isOffline!: boolean;
exifInfo?: ExifResponseDto;
smartInfo?: SmartInfoResponseDto;
tags?: TagResponseDto[];
people?: PersonWithFacesResponseDto[];
unassignedFaces?: AssetFaceWithoutPersonResponseDto[];
Expand Down Expand Up @@ -141,7 +139,6 @@ export function mapAsset(entity: AssetEntity, options: AssetMapOptions = {}): As
isTrashed: !!entity.deletedAt,
duration: entity.duration ?? '0:00:00.00000',
exifInfo: entity.exifInfo ? mapExif(entity.exifInfo) : undefined,
smartInfo: entity.smartInfo ? mapSmartInfo(entity.smartInfo) : undefined,
livePhotoVideoId: entity.livePhotoVideoId,
tags: entity.tags?.map((tag) => mapTag(tag)),
people: peopleWithFaces(entity.faces),
Expand All @@ -161,15 +158,3 @@ export class MemoryLaneResponseDto {

assets!: AssetResponseDto[];
}

export class SmartInfoResponseDto {
tags?: string[] | null;
objects?: string[] | null;
}

export function mapSmartInfo(entity: SmartInfoEntity): SmartInfoResponseDto {
return {
tags: entity.tags,
objects: entity.objects,
};
}
4 changes: 0 additions & 4 deletions server/src/entities/asset.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { AssetJobStatusEntity } from 'src/entities/asset-job-status.entity';
import { ExifEntity } from 'src/entities/exif.entity';
import { LibraryEntity } from 'src/entities/library.entity';
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
import { SmartInfoEntity } from 'src/entities/smart-info.entity';
import { SmartSearchEntity } from 'src/entities/smart-search.entity';
import { StackEntity } from 'src/entities/stack.entity';
import { TagEntity } from 'src/entities/tag.entity';
Expand Down Expand Up @@ -143,9 +142,6 @@ export class AssetEntity {
@OneToOne(() => ExifEntity, (exifEntity) => exifEntity.asset)
exifInfo?: ExifEntity;

@OneToOne(() => SmartInfoEntity, (smartInfoEntity) => smartInfoEntity.asset)
smartInfo?: SmartInfoEntity;

@OneToOne(() => SmartSearchEntity, (smartSearchEntity) => smartSearchEntity.asset)
smartSearch?: SmartSearchEntity;

Expand Down
2 changes: 0 additions & 2 deletions server/src/entities/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { PartnerEntity } from 'src/entities/partner.entity';
import { PersonEntity } from 'src/entities/person.entity';
import { SessionEntity } from 'src/entities/session.entity';
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
import { SmartInfoEntity } from 'src/entities/smart-info.entity';
import { SmartSearchEntity } from 'src/entities/smart-search.entity';
import { StackEntity } from 'src/entities/stack.entity';
import { SystemMetadataEntity } from 'src/entities/system-metadata.entity';
Expand Down Expand Up @@ -46,7 +45,6 @@ export const entities = [
PartnerEntity,
PersonEntity,
SharedLinkEntity,
SmartInfoEntity,
SmartSearchEntity,
StackEntity,
SystemMetadataEntity,
Expand Down
18 changes: 0 additions & 18 deletions server/src/entities/smart-info.entity.ts

This file was deleted.

4 changes: 0 additions & 4 deletions server/src/interfaces/asset.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ export enum WithoutProperty {
EXIF = 'exif',
SMART_SEARCH = 'smart-search',
DUPLICATE = 'duplicate',
OBJECT_TAGS = 'object-tags',
FACES = 'faces',
PERSON = 'person',
SIDECAR = 'sidecar',
}

Expand Down Expand Up @@ -94,7 +92,6 @@ export type AssetWithoutRelations = Omit<
| 'library'
| 'exifInfo'
| 'sharedLinks'
| 'smartInfo'
| 'smartSearch'
| 'tags'
>;
Expand Down Expand Up @@ -190,7 +187,6 @@ export interface IAssetRepository {
upsertExif(exif: Partial<ExifEntity>): Promise<void>;
upsertJobStatus(...jobStatus: Partial<AssetJobStatusEntity>[]): Promise<void>;
getAssetIdByCity(userId: string, options: AssetExploreFieldOptions): Promise<SearchExploreItem<string>>;
getAssetIdByTag(userId: string, options: AssetExploreFieldOptions): Promise<SearchExploreItem<string>>;
getDuplicates(options: AssetBuilderOptions): Promise<AssetEntity[]>;
getAllForUserFullSync(options: AssetFullSyncOptions): Promise<AssetEntity[]>;
getChangedDeltaSync(options: AssetDeltaSyncOptions): Promise<AssetEntity[]>;
Expand Down
Loading

0 comments on commit 64831e2

Please sign in to comment.