Skip to content

Commit

Permalink
enum | string
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-brazhenko committed Jul 27, 2023
1 parent af4d808 commit a06ee84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion server/src/infra/entities/exif.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class ExifEntity {
longitude!: number | null;

@Column({ type: 'varchar', default: ProjectionType.NONE })
projectionType!: ProjectionType;
projectionType!: ProjectionType | string;

@Column({ type: 'varchar', nullable: true })
city!: string | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,18 +337,11 @@ export class MetadataExtractionProcessor {
}
}

const exifProjectionType = getExifProperty('ProjectionType');
let projectionType: ProjectionType = ProjectionType.NONE;

if (exifProjectionType) {
const exifPropertyUpper = exifProjectionType.toUpperCase();

if (exifPropertyUpper in ProjectionType) {
projectionType = exifPropertyUpper as ProjectionType;
}
const projectionType = getExifProperty('ProjectionType');
if (projectionType) {
newExif.projectionType = String(projectionType).toUpperCase();
}

newExif.projectionType = projectionType;
newExif.livePhotoCID = getExifProperty('MediaGroupUUID');
if (newExif.livePhotoCID && !asset.livePhotoVideoId) {
const motionAsset = await this.assetRepository.findLivePhotoMatch({
Expand Down

0 comments on commit a06ee84

Please sign in to comment.