mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
33 lines
911 B
TypeScript
33 lines
911 B
TypeScript
|
|
import { Inject } from '@nestjs/common';
|
||
|
|
import { SystemConfig } from 'src/config';
|
||
|
|
import { ILoggerRepository } from 'src/interfaces/logger.interface';
|
||
|
|
import { ISystemMetadataRepository } from 'src/interfaces/system-metadata.interface';
|
||
|
|
import { getConfig, updateConfig } from 'src/utils/config';
|
||
|
|
|
||
|
|
export class BaseService {
|
||
|
|
constructor(
|
||
|
|
@Inject(ISystemMetadataRepository) protected systemMetadataRepository: ISystemMetadataRepository,
|
||
|
|
@Inject(ILoggerRepository) protected logger: ILoggerRepository,
|
||
|
|
) {}
|
||
|
|
|
||
|
|
getConfig(options: { withCache: boolean }) {
|
||
|
|
return getConfig(
|
||
|
|
{
|
||
|
|
metadataRepo: this.systemMetadataRepository,
|
||
|
|
logger: this.logger,
|
||
|
|
},
|
||
|
|
options,
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
updateConfig(newConfig: SystemConfig) {
|
||
|
|
return updateConfig(
|
||
|
|
{
|
||
|
|
metadataRepo: this.systemMetadataRepository,
|
||
|
|
logger: this.logger,
|
||
|
|
},
|
||
|
|
newConfig,
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|