1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-19 18:26:46 +01:00

refactor(server): rename filesystem provider -> storage repo (#8277)

rename filesystem provider -> storage repo
This commit is contained in:
Daniel Dietzler 2024-03-25 21:45:21 +01:00 committed by GitHub
parent d431d37454
commit c56c04a82b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 8 deletions

View file

@ -78,7 +78,6 @@ import { AuditRepository } from 'src/repositories/audit.repository';
import { CryptoRepository } from 'src/repositories/crypto.repository'; import { CryptoRepository } from 'src/repositories/crypto.repository';
import { DatabaseRepository } from 'src/repositories/database.repository'; import { DatabaseRepository } from 'src/repositories/database.repository';
import { EventRepository } from 'src/repositories/event.repository'; import { EventRepository } from 'src/repositories/event.repository';
import { FilesystemProvider } from 'src/repositories/filesystem.provider';
import { JobRepository } from 'src/repositories/job.repository'; import { JobRepository } from 'src/repositories/job.repository';
import { LibraryRepository } from 'src/repositories/library.repository'; import { LibraryRepository } from 'src/repositories/library.repository';
import { MachineLearningRepository } from 'src/repositories/machine-learning.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 { SearchRepository } from 'src/repositories/search.repository';
import { ServerInfoRepository } from 'src/repositories/server-info.repository'; import { ServerInfoRepository } from 'src/repositories/server-info.repository';
import { SharedLinkRepository } from 'src/repositories/shared-link.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 { SystemConfigRepository } from 'src/repositories/system-config.repository';
import { SystemMetadataRepository } from 'src/repositories/system-metadata.repository'; import { SystemMetadataRepository } from 'src/repositories/system-metadata.repository';
import { TagRepository } from 'src/repositories/tag.repository'; import { TagRepository } from 'src/repositories/tag.repository';
@ -216,7 +216,7 @@ const repositories: Provider[] = [
{ provide: IServerInfoRepository, useClass: ServerInfoRepository }, { provide: IServerInfoRepository, useClass: ServerInfoRepository },
{ provide: ISharedLinkRepository, useClass: SharedLinkRepository }, { provide: ISharedLinkRepository, useClass: SharedLinkRepository },
{ provide: ISearchRepository, useClass: SearchRepository }, { provide: ISearchRepository, useClass: SearchRepository },
{ provide: IStorageRepository, useClass: FilesystemProvider }, { provide: IStorageRepository, useClass: StorageRepository },
{ provide: ISystemConfigRepository, useClass: SystemConfigRepository }, { provide: ISystemConfigRepository, useClass: SystemConfigRepository },
{ provide: ISystemMetadataRepository, useClass: SystemMetadataRepository }, { provide: ISystemMetadataRepository, useClass: SystemMetadataRepository },
{ provide: ITagRepository, useClass: TagRepository }, { provide: ITagRepository, useClass: TagRepository },

View file

@ -1,6 +1,6 @@
import mockfs from 'mock-fs'; import mockfs from 'mock-fs';
import { CrawlOptionsDto } from 'src/dtos/library.dto'; import { CrawlOptionsDto } from 'src/dtos/library.dto';
import { FilesystemProvider } from 'src/repositories/filesystem.provider'; import { StorageRepository } from 'src/repositories/storage.repository';
interface Test { interface Test {
test: string; test: string;
@ -179,11 +179,11 @@ const tests: Test[] = [
}, },
]; ];
describe(FilesystemProvider.name, () => { describe(StorageRepository.name, () => {
let sut: FilesystemProvider; let sut: StorageRepository;
beforeEach(() => { beforeEach(() => {
sut = new FilesystemProvider(); sut = new StorageRepository();
}); });
afterEach(() => { afterEach(() => {

View file

@ -18,8 +18,8 @@ import { ImmichLogger } from 'src/utils/logger';
import { mimeTypes } from 'src/utils/mime-types'; import { mimeTypes } from 'src/utils/mime-types';
@Instrumentation() @Instrumentation()
export class FilesystemProvider implements IStorageRepository { export class StorageRepository implements IStorageRepository {
private logger = new ImmichLogger(FilesystemProvider.name); private logger = new ImmichLogger(StorageRepository.name);
readdir(folder: string): Promise<string[]> { readdir(folder: string): Promise<string[]> {
return fs.readdir(folder); return fs.readdir(folder);