* Add Exif-Rating * Integrate star rating as own component * Add e2e tests for rating and validation * Rename component and async handleChangeRating * Display rating can be enabled in app settings * Correct i18n reference Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> * Star rating: change from slider to buttons * Star rating for clarity * Design updates. * Renaming and code optimization * chore: clean up * chore: e2e formatting * light mode border and default value --------- Co-authored-by: Christoph Suter <christoph@suter-burri.ch> Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com> Co-authored-by: Jason Rasmussen <jrasm91@gmail.com> Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
70 lines
2.3 KiB
TypeScript
70 lines
2.3 KiB
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { ExifEntity } from 'src/entities/exif.entity';
|
|
|
|
export class ExifResponseDto {
|
|
make?: string | null = null;
|
|
model?: string | null = null;
|
|
exifImageWidth?: number | null = null;
|
|
exifImageHeight?: number | null = null;
|
|
|
|
@ApiProperty({ type: 'integer', format: 'int64' })
|
|
fileSizeInByte?: number | null = null;
|
|
orientation?: string | null = null;
|
|
dateTimeOriginal?: Date | null = null;
|
|
modifyDate?: Date | null = null;
|
|
timeZone?: string | null = null;
|
|
lensModel?: string | null = null;
|
|
fNumber?: number | null = null;
|
|
focalLength?: number | null = null;
|
|
iso?: number | null = null;
|
|
exposureTime?: string | null = null;
|
|
latitude?: number | null = null;
|
|
longitude?: number | null = null;
|
|
city?: string | null = null;
|
|
state?: string | null = null;
|
|
country?: string | null = null;
|
|
description?: string | null = null;
|
|
projectionType?: string | null = null;
|
|
rating?: number | null = null;
|
|
}
|
|
|
|
export function mapExif(entity: ExifEntity): ExifResponseDto {
|
|
return {
|
|
make: entity.make,
|
|
model: entity.model,
|
|
exifImageWidth: entity.exifImageWidth,
|
|
exifImageHeight: entity.exifImageHeight,
|
|
fileSizeInByte: entity.fileSizeInByte ? Number.parseInt(entity.fileSizeInByte.toString()) : null,
|
|
orientation: entity.orientation,
|
|
dateTimeOriginal: entity.dateTimeOriginal,
|
|
modifyDate: entity.modifyDate,
|
|
timeZone: entity.timeZone,
|
|
lensModel: entity.lensModel,
|
|
fNumber: entity.fNumber,
|
|
focalLength: entity.focalLength,
|
|
iso: entity.iso,
|
|
exposureTime: entity.exposureTime,
|
|
latitude: entity.latitude,
|
|
longitude: entity.longitude,
|
|
city: entity.city,
|
|
state: entity.state,
|
|
country: entity.country,
|
|
description: entity.description,
|
|
projectionType: entity.projectionType,
|
|
rating: entity.rating,
|
|
};
|
|
}
|
|
|
|
export function mapSanitizedExif(entity: ExifEntity): ExifResponseDto {
|
|
return {
|
|
fileSizeInByte: entity.fileSizeInByte ? Number.parseInt(entity.fileSizeInByte.toString()) : null,
|
|
orientation: entity.orientation,
|
|
dateTimeOriginal: entity.dateTimeOriginal,
|
|
timeZone: entity.timeZone,
|
|
projectionType: entity.projectionType,
|
|
exifImageWidth: entity.exifImageWidth,
|
|
exifImageHeight: entity.exifImageHeight,
|
|
rating: entity.rating,
|
|
};
|
|
}
|