mirror of
https://github.com/immich-app/immich.git
synced 2025-11-23 10:40:41 +09:00
feat(server) user-defined storage structure (#1098)
[Breaking] newly uploaded file will conform to the default structure of `{uploadLocation}/{userId}/year/year-month-day/filename.ext`
This commit is contained in:
@@ -1,11 +1,24 @@
|
||||
import { SystemConfigEntity } from '@app/database/entities/system-config.entity';
|
||||
import { Module } from '@nestjs/common';
|
||||
import { Module, Provider } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { ImmichConfigService } from './immich-config.service';
|
||||
|
||||
export const INITIAL_SYSTEM_CONFIG = 'INITIAL_SYSTEM_CONFIG';
|
||||
|
||||
const providers: Provider[] = [
|
||||
ImmichConfigService,
|
||||
{
|
||||
provide: INITIAL_SYSTEM_CONFIG,
|
||||
inject: [ImmichConfigService],
|
||||
useFactory: async (configService: ImmichConfigService) => {
|
||||
return configService.getConfig();
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([SystemConfigEntity])],
|
||||
providers: [ImmichConfigService],
|
||||
exports: [ImmichConfigService],
|
||||
providers: [...providers],
|
||||
exports: [...providers],
|
||||
})
|
||||
export class ImmichConfigModule {}
|
||||
|
||||
Reference in New Issue
Block a user