Skip to content

Commit

Permalink
enum -> varchar;projectiontypeenum->projectiontype
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-brazhenko committed Jul 27, 2023
1 parent df7ab47 commit f164f6b
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 36 deletions.
8 changes: 4 additions & 4 deletions cli/src/api/open-api/api.ts

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

4 changes: 2 additions & 2 deletions server/immich-openapi-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5459,7 +5459,7 @@
},
"projectionType": {
"default": "NONE",
"$ref": "#/components/schemas/ProjectionTypeEnum"
"$ref": "#/components/schemas/ProjectionType"
},
"make": {
"type": "string",
Expand Down Expand Up @@ -6034,7 +6034,7 @@
}
}
},
"ProjectionTypeEnum": {
"ProjectionType": {
"type": "string",
"enum": [
"EQUIRECTANGULAR",
Expand Down
4 changes: 1 addition & 3 deletions server/src/infra/entities/exif.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ export class ExifEntity {
longitude!: number | null;

@Column({
type: 'enum',
enum: ProjectionType,
enumName: 'projectionType',
type: 'varchar',
default: ProjectionType.NONE,
})
projectionType!: ProjectionType;
Expand Down
19 changes: 0 additions & 19 deletions server/src/infra/migrations/1690217088596-Panoramas.ts

This file was deleted.

13 changes: 13 additions & 0 deletions server/src/infra/migrations/1690469489288-Panoramas.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class Panoramas1690217088596 implements MigrationInterface {
name = 'Panoramas1690217088596';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "exif" ADD "projectionType" character varying NOT NULL DEFAULT 'NONE'`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "exif" DROP COLUMN "projectionType"`);
}
}
8 changes: 4 additions & 4 deletions web/src/api/open-api/api.ts

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

4 changes: 2 additions & 2 deletions web/src/lib/components/asset-viewer/asset-viewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
AssetResponseDto,
AssetTypeEnum,
SharedLinkResponseDto,
ProjectionTypeEnum,
ProjectionType,
} from '@api';
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
import ChevronLeft from 'svelte-material-icons/ChevronLeft.svelte';
Expand Down Expand Up @@ -301,7 +301,7 @@
on:close={closeViewer}
on:onVideoEnded={() => (shouldPlayMotionPhoto = false)}
/>
{:else if asset.exifInfo?.projectionType === ProjectionTypeEnum.Equirectangular}
{:else if asset.exifInfo?.projectionType === ProjectionType.Equirectangular}
<PanoramaViewer {publicSharedKey} {asset} />
{:else}
<PhotoViewer {publicSharedKey} {asset} on:close={closeViewer} />
Expand Down
4 changes: 2 additions & 2 deletions web/src/lib/components/assets/thumbnail/thumbnail.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import IntersectionObserver from '$lib/components/asset-viewer/intersection-observer.svelte';
import { timeToSeconds } from '$lib/utils/time-to-seconds';
import { api, AssetResponseDto, AssetTypeEnum, ProjectionTypeEnum, ThumbnailFormat } from '@api';
import { api, AssetResponseDto, AssetTypeEnum, ProjectionType, ThumbnailFormat } from '@api';
import { createEventDispatcher } from 'svelte';
import ArchiveArrowDownOutline from 'svelte-material-icons/ArchiveArrowDownOutline.svelte';
import CheckCircle from 'svelte-material-icons/CheckCircle.svelte';
Expand Down Expand Up @@ -125,7 +125,7 @@
</div>
{/if}

{#if asset.type === AssetTypeEnum.Image && asset.exifInfo?.projectionType === ProjectionTypeEnum.Equirectangular}
{#if asset.type === AssetTypeEnum.Image && asset.exifInfo?.projectionType === ProjectionType.Equirectangular}
<div class="absolute right-0 top-0 z-20 flex place-items-center gap-1 text-xs font-medium text-white">
<span class="pr-2 pt-2">
<Rotate360Icon size="24" />
Expand Down

0 comments on commit f164f6b

Please sign in to comment.