2019-02-02 18:18:35 -05:00
|
|
|
import {ChildEntity, Column} from 'typeorm';
|
|
|
|
import {CameraMetadata, GPSMetadata, PhotoDTO, PhotoMetadata, PositionMetaData} from '../../../../common/entities/PhotoDTO';
|
2018-11-17 19:32:31 +01:00
|
|
|
import {MediaEntity, MediaMetadataEntity} from './MediaEntity';
|
2017-10-19 12:08:07 -04:00
|
|
|
|
|
|
|
export class CameraMetadataEntity implements CameraMetadata {
|
2016-12-27 20:55:51 +01:00
|
|
|
|
2019-02-02 22:22:51 -05:00
|
|
|
@Column('int', {nullable: true, unsigned: true})
|
2017-10-19 12:08:07 -04:00
|
|
|
ISO: number;
|
2016-12-27 20:55:51 +01:00
|
|
|
|
2018-03-30 15:30:30 -04:00
|
|
|
@Column('text', {nullable: true})
|
2017-10-19 12:08:07 -04:00
|
|
|
model: string;
|
2016-12-27 20:55:51 +01:00
|
|
|
|
2018-03-30 15:30:30 -04:00
|
|
|
@Column('text', {nullable: true})
|
2018-12-18 00:05:12 +01:00
|
|
|
make: string;
|
2016-12-27 20:55:51 +01:00
|
|
|
|
2019-02-02 18:18:35 -05:00
|
|
|
@Column('float', {nullable: true})
|
2017-10-19 12:08:07 -04:00
|
|
|
fStop: number;
|
2016-12-27 20:55:51 +01:00
|
|
|
|
2019-02-02 18:18:35 -05:00
|
|
|
@Column('float', {nullable: true})
|
2017-10-19 12:08:07 -04:00
|
|
|
exposure: number;
|
2016-12-27 20:55:51 +01:00
|
|
|
|
2019-02-02 22:22:51 -05:00
|
|
|
@Column('float', {nullable: true})
|
2017-10-19 12:08:07 -04:00
|
|
|
focalLength: number;
|
2016-12-27 20:55:51 +01:00
|
|
|
|
2018-03-30 15:30:30 -04:00
|
|
|
@Column('text', {nullable: true})
|
2017-10-19 12:08:07 -04:00
|
|
|
lens: string;
|
|
|
|
}
|
2016-12-27 20:55:51 +01:00
|
|
|
|
|
|
|
|
2017-12-17 21:34:07 -05:00
|
|
|
export class GPSMetadataEntity implements GPSMetadata {
|
|
|
|
|
2019-02-02 18:18:35 -05:00
|
|
|
@Column('float', {nullable: true})
|
2017-12-17 21:34:07 -05:00
|
|
|
latitude: number;
|
2019-02-02 18:18:35 -05:00
|
|
|
@Column('float', {nullable: true})
|
2017-12-17 21:34:07 -05:00
|
|
|
longitude: number;
|
2019-02-02 22:22:51 -05:00
|
|
|
@Column('int', {nullable: true})
|
2017-12-17 21:34:07 -05:00
|
|
|
altitude: number;
|
|
|
|
}
|
|
|
|
|
2019-01-12 16:41:45 +01:00
|
|
|
|
2017-10-19 12:08:07 -04:00
|
|
|
export class PositionMetaDataEntity implements PositionMetaData {
|
2016-12-27 20:55:51 +01:00
|
|
|
|
2017-10-19 12:08:07 -04:00
|
|
|
@Column(type => GPSMetadataEntity)
|
|
|
|
GPSData: GPSMetadataEntity;
|
2016-12-27 20:55:51 +01:00
|
|
|
|
2018-03-30 15:30:30 -04:00
|
|
|
@Column('text', {nullable: true})
|
2017-10-19 12:08:07 -04:00
|
|
|
country: string;
|
2016-12-27 20:55:51 +01:00
|
|
|
|
2018-03-30 15:30:30 -04:00
|
|
|
@Column('text', {nullable: true})
|
2017-10-19 12:08:07 -04:00
|
|
|
state: string;
|
2016-12-27 20:55:51 +01:00
|
|
|
|
2018-03-30 15:30:30 -04:00
|
|
|
@Column('text', {nullable: true})
|
2017-10-19 12:08:07 -04:00
|
|
|
city: string;
|
|
|
|
}
|
2016-12-27 20:55:51 +01:00
|
|
|
|
|
|
|
|
2018-11-17 19:32:31 +01:00
|
|
|
export class PhotoMetadataEntity extends MediaMetadataEntity implements PhotoMetadata {
|
2018-12-18 00:05:12 +01:00
|
|
|
/*
|
|
|
|
@Column('simple-array')
|
|
|
|
keywords: string[];
|
2017-12-17 21:34:07 -05:00
|
|
|
|
2018-12-18 00:05:12 +01:00
|
|
|
@Column(type => CameraMetadataEntity)
|
|
|
|
cameraData: CameraMetadataEntity;
|
2017-12-17 21:34:07 -05:00
|
|
|
|
2018-12-18 00:05:12 +01:00
|
|
|
@Column(type => PositionMetaDataEntity)
|
|
|
|
positionData: PositionMetaDataEntity;
|
2017-12-17 21:34:07 -05:00
|
|
|
|
2018-12-18 00:05:12 +01:00
|
|
|
@Column('tinyint', {default: OrientationTypes.TOP_LEFT})
|
|
|
|
orientation: OrientationTypes;
|
|
|
|
*/
|
2017-10-19 12:08:07 -04:00
|
|
|
}
|
2016-12-27 20:55:51 +01:00
|
|
|
|
2017-12-17 21:34:07 -05:00
|
|
|
|
2018-11-17 19:32:31 +01:00
|
|
|
@ChildEntity()
|
|
|
|
export class PhotoEntity extends MediaEntity implements PhotoDTO {
|
2017-12-17 21:34:07 -05:00
|
|
|
@Column(type => PhotoMetadataEntity)
|
|
|
|
metadata: PhotoMetadataEntity;
|
2017-10-19 12:08:07 -04:00
|
|
|
}
|