fix(server,web,mobile): Incorrectly record and show timestamp and time zone of the asset (#706)

Implemented a mechanism to extract the correct time zone from the GPS coordinate if presented in the file's EXIF, and to convert the timestamp to the correct UTC time so that the time will show correctly based on the mobile/web local time zone.
This commit is contained in:
Alex
2022-09-22 15:58:17 -05:00
committed by GitHub
parent fc194021a4
commit e5459b68ff
16 changed files with 392 additions and 63 deletions

View File

@@ -11,7 +11,6 @@ import {
UseInterceptors,
UploadedFile,
Response,
Request,
ParseBoolPipe,
} from '@nestjs/common';
import { UserService } from './user.service';
@@ -22,7 +21,7 @@ import { AdminRolesGuard } from '../../middlewares/admin-role-guard.middleware';
import { UpdateUserDto } from './dto/update-user.dto';
import { FileInterceptor } from '@nestjs/platform-express';
import { profileImageUploadOption } from '../../config/profile-image-upload.config';
import { Response as Res, Request as Req } from 'express';
import { Response as Res } from 'express';
import { ApiBearerAuth, ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger';
import { UserResponseDto } from './response-dto/user-response.dto';
import { UserCountResponseDto } from './response-dto/user-count-response.dto';
@@ -93,9 +92,7 @@ export class UserController {
async createProfileImage(
@GetAuthUser() authUser: AuthUserDto,
@UploadedFile() fileInfo: Express.Multer.File,
@Request() req: Req,
): Promise<CreateProfileImageResponseDto> {
console.log(req.body, req.file);
return await this.userService.createProfileImage(authUser, fileInfo);
}

View File

@@ -15,7 +15,6 @@ import { AppController } from './app.controller';
import { ScheduleModule } from '@nestjs/schedule';
import { ScheduleTasksModule } from './modules/schedule-tasks/schedule-tasks.module';
import { DatabaseModule } from '@app/database';
import { AppLoggerMiddleware } from './middlewares/app-logger.middleware';
@Module({
imports: [
@@ -65,7 +64,7 @@ export class AppModule implements NestModule {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
configure(consumer: MiddlewareConsumer): void {
if (process.env.NODE_ENV == 'development') {
consumer.apply(AppLoggerMiddleware).forRoutes('*');
// consumer.apply(AppLoggerMiddleware).forRoutes('*');
}
}
}