refactor(server): make storage core singleton (#4608)

This commit is contained in:
Daniel Dietzler
2023-10-23 17:52:21 +02:00
committed by GitHub
parent 2288b022bc
commit 6b25435b4f
10 changed files with 80 additions and 90 deletions
+2 -2
View File
@@ -58,7 +58,7 @@ export class PersonService {
) {
this.access = AccessCore.create(accessRepository);
this.configCore = SystemConfigCore.create(configRepository);
this.storageCore = new StorageCore(storageRepository, assetRepository, moveRepository, repository);
this.storageCore = StorageCore.create(assetRepository, moveRepository, repository, storageRepository);
}
async getAll(authUser: AuthUserDto, dto: PersonSearchDto): Promise<PeopleResponseDto> {
@@ -309,7 +309,7 @@ export class PersonService {
}
this.logger.verbose(`Cropping face for person: ${personId}`);
const thumbnailPath = this.storageCore.getPersonThumbnailPath(person);
const thumbnailPath = StorageCore.getPersonThumbnailPath(person);
this.storageCore.ensureFolders(thumbnailPath);
const halfWidth = (x2 - x1) / 2;