From c56c04a82b87ec58ae3bd8eaf8df2feb8d4d8fa5 Mon Sep 17 00:00:00 2001 From: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com> Date: Mon, 25 Mar 2024 21:45:21 +0100 Subject: [PATCH] refactor(server): rename filesystem provider -> storage repo (#8277) rename filesystem provider -> storage repo --- server/src/app.module.ts | 4 ++-- ...system.provider.spec.ts => storage.repository.spec.ts} | 8 ++++---- .../{filesystem.provider.ts => storage.repository.ts} | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) rename server/src/repositories/{filesystem.provider.spec.ts => storage.repository.spec.ts} (96%) rename server/src/repositories/{filesystem.provider.ts => storage.repository.ts} (97%) diff --git a/server/src/app.module.ts b/server/src/app.module.ts index 644b2998e9..aedd6adf1f 100644 --- a/server/src/app.module.ts +++ b/server/src/app.module.ts @@ -78,7 +78,6 @@ import { AuditRepository } from 'src/repositories/audit.repository'; import { CryptoRepository } from 'src/repositories/crypto.repository'; import { DatabaseRepository } from 'src/repositories/database.repository'; import { EventRepository } from 'src/repositories/event.repository'; -import { FilesystemProvider } from 'src/repositories/filesystem.provider'; import { JobRepository } from 'src/repositories/job.repository'; import { LibraryRepository } from 'src/repositories/library.repository'; import { MachineLearningRepository } from 'src/repositories/machine-learning.repository'; @@ -91,6 +90,7 @@ import { PersonRepository } from 'src/repositories/person.repository'; import { SearchRepository } from 'src/repositories/search.repository'; import { ServerInfoRepository } from 'src/repositories/server-info.repository'; import { SharedLinkRepository } from 'src/repositories/shared-link.repository'; +import { StorageRepository } from 'src/repositories/storage.repository'; import { SystemConfigRepository } from 'src/repositories/system-config.repository'; import { SystemMetadataRepository } from 'src/repositories/system-metadata.repository'; import { TagRepository } from 'src/repositories/tag.repository'; @@ -216,7 +216,7 @@ const repositories: Provider[] = [ { provide: IServerInfoRepository, useClass: ServerInfoRepository }, { provide: ISharedLinkRepository, useClass: SharedLinkRepository }, { provide: ISearchRepository, useClass: SearchRepository }, - { provide: IStorageRepository, useClass: FilesystemProvider }, + { provide: IStorageRepository, useClass: StorageRepository }, { provide: ISystemConfigRepository, useClass: SystemConfigRepository }, { provide: ISystemMetadataRepository, useClass: SystemMetadataRepository }, { provide: ITagRepository, useClass: TagRepository }, diff --git a/server/src/repositories/filesystem.provider.spec.ts b/server/src/repositories/storage.repository.spec.ts similarity index 96% rename from server/src/repositories/filesystem.provider.spec.ts rename to server/src/repositories/storage.repository.spec.ts index c9790767ce..b92a26904f 100644 --- a/server/src/repositories/filesystem.provider.spec.ts +++ b/server/src/repositories/storage.repository.spec.ts @@ -1,6 +1,6 @@ import mockfs from 'mock-fs'; import { CrawlOptionsDto } from 'src/dtos/library.dto'; -import { FilesystemProvider } from 'src/repositories/filesystem.provider'; +import { StorageRepository } from 'src/repositories/storage.repository'; interface Test { test: string; @@ -179,11 +179,11 @@ const tests: Test[] = [ }, ]; -describe(FilesystemProvider.name, () => { - let sut: FilesystemProvider; +describe(StorageRepository.name, () => { + let sut: StorageRepository; beforeEach(() => { - sut = new FilesystemProvider(); + sut = new StorageRepository(); }); afterEach(() => { diff --git a/server/src/repositories/filesystem.provider.ts b/server/src/repositories/storage.repository.ts similarity index 97% rename from server/src/repositories/filesystem.provider.ts rename to server/src/repositories/storage.repository.ts index b4f2311208..7e1c8d59e2 100644 --- a/server/src/repositories/filesystem.provider.ts +++ b/server/src/repositories/storage.repository.ts @@ -18,8 +18,8 @@ import { ImmichLogger } from 'src/utils/logger'; import { mimeTypes } from 'src/utils/mime-types'; @Instrumentation() -export class FilesystemProvider implements IStorageRepository { - private logger = new ImmichLogger(FilesystemProvider.name); +export class StorageRepository implements IStorageRepository { + private logger = new ImmichLogger(StorageRepository.name); readdir(folder: string): Promise { return fs.readdir(folder);