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.
71 lines
2.2 KiB
TypeScript
71 lines
2.2 KiB
TypeScript
import { immichAppConfig } from '@app/common/config';
|
|
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
|
|
import { UserModule } from './api-v1/user/user.module';
|
|
import { AssetModule } from './api-v1/asset/asset.module';
|
|
import { AuthModule } from './api-v1/auth/auth.module';
|
|
import { ImmichJwtModule } from './modules/immich-jwt/immich-jwt.module';
|
|
import { DeviceInfoModule } from './api-v1/device-info/device-info.module';
|
|
import { ConfigModule } from '@nestjs/config';
|
|
import { BullModule } from '@nestjs/bull';
|
|
import { ServerInfoModule } from './api-v1/server-info/server-info.module';
|
|
import { BackgroundTaskModule } from './modules/background-task/background-task.module';
|
|
import { CommunicationModule } from './api-v1/communication/communication.module';
|
|
import { AlbumModule } from './api-v1/album/album.module';
|
|
import { AppController } from './app.controller';
|
|
import { ScheduleModule } from '@nestjs/schedule';
|
|
import { ScheduleTasksModule } from './modules/schedule-tasks/schedule-tasks.module';
|
|
import { DatabaseModule } from '@app/database';
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule.forRoot(immichAppConfig),
|
|
|
|
DatabaseModule,
|
|
UserModule,
|
|
|
|
AssetModule,
|
|
|
|
AuthModule,
|
|
|
|
ImmichJwtModule,
|
|
|
|
DeviceInfoModule,
|
|
|
|
BullModule.forRootAsync({
|
|
useFactory: async () => ({
|
|
prefix: 'immich_bull',
|
|
redis: {
|
|
host: process.env.REDIS_HOSTNAME || 'immich_redis',
|
|
port: parseInt(process.env.REDIS_PORT || '6379'),
|
|
db: parseInt(process.env.REDIS_DBINDEX || '0'),
|
|
password: process.env.REDIS_PASSWORD || undefined,
|
|
path: process.env.REDIS_SOCKET || undefined,
|
|
},
|
|
}),
|
|
}),
|
|
|
|
ServerInfoModule,
|
|
|
|
BackgroundTaskModule,
|
|
|
|
CommunicationModule,
|
|
|
|
AlbumModule,
|
|
|
|
ScheduleModule.forRoot(),
|
|
|
|
ScheduleTasksModule,
|
|
],
|
|
controllers: [AppController],
|
|
providers: [],
|
|
})
|
|
export class AppModule implements NestModule {
|
|
// TODO: check if consumer is needed or remove
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
configure(consumer: MiddlewareConsumer): void {
|
|
if (process.env.NODE_ENV == 'development') {
|
|
// consumer.apply(AppLoggerMiddleware).forRoutes('*');
|
|
}
|
|
}
|
|
}
|