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
@@ -80,7 +80,7 @@ export class MetadataService {
@Inject(IPersonRepository) personRepository: IPersonRepository,
) {
this.configCore = SystemConfigCore.create(configRepository);
this.storageCore = new StorageCore(storageRepository, assetRepository, moveRepository, personRepository);
this.storageCore = StorageCore.create(assetRepository, moveRepository, personRepository, storageRepository);
this.configCore.config$.subscribe(() => this.init());
}
@@ -294,7 +294,7 @@ export class MetadataService {
});
const checksum = this.cryptoRepository.hashSha1(video);
const motionPath = this.storageCore.getAndroidMotionPath(asset);
const motionPath = StorageCore.getAndroidMotionPath(asset);
this.storageCore.ensureFolders(motionPath);
let motionAsset = await this.assetRepository.getByChecksum(asset.ownerId, checksum);