diff --git a/api/src/unraid-api/unraid-file-modifier/unraid-file-modifier.module.ts b/api/src/unraid-api/unraid-file-modifier/unraid-file-modifier.module.ts index 6434b68eb..869b4f625 100644 --- a/api/src/unraid-api/unraid-file-modifier/unraid-file-modifier.module.ts +++ b/api/src/unraid-api/unraid-file-modifier/unraid-file-modifier.module.ts @@ -1,7 +1,8 @@ import { Module } from '@nestjs/common'; -import { FileModificationService } from './unraid-file-modifier.service'; + +import { UnraidFileModificationService } from './unraid-file-modifier.service'; @Module({ - providers: [FileModificationService] + providers: [UnraidFileModificationService], }) export class UnraidFileModifierModule {} diff --git a/api/src/unraid-api/unraid-file-modifier/unraid-file-modifier.service.ts b/api/src/unraid-api/unraid-file-modifier/unraid-file-modifier.service.ts index 7778f6bb9..77dd45341 100644 --- a/api/src/unraid-api/unraid-file-modifier/unraid-file-modifier.service.ts +++ b/api/src/unraid-api/unraid-file-modifier/unraid-file-modifier.service.ts @@ -19,8 +19,8 @@ export interface FileModification { // Step 2: Create a FileModificationService @Injectable() -export class FileModificationService implements OnModuleInit, OnModuleDestroy { - private readonly logger = new Logger(FileModificationService.name); +export class UnraidFileModificationService implements OnModuleInit, OnModuleDestroy { + private readonly logger = new Logger(UnraidFileModificationService.name); private history: FileModification[] = []; // Keeps track of applied modifications async onModuleInit() { @@ -71,12 +71,16 @@ export class FileModificationService implements OnModuleInit, OnModuleDestroy { try { const shouldApplyWithReason = await modification.shouldApply(); if (shouldApplyWithReason.shouldApply) { - this.logger.log(`Applying modification: ${modification.id} - ${shouldApplyWithReason.reason}`); + this.logger.log( + `Applying modification: ${modification.id} - ${shouldApplyWithReason.reason}` + ); await modification.apply(); this.history.push(modification); // Store modification in history this.logger.log(`Modification applied successfully: ${modification.id}`); } else { - this.logger.log(`Skipping modification: ${modification.id} - ${shouldApplyWithReason.reason}`); + this.logger.log( + `Skipping modification: ${modification.id} - ${shouldApplyWithReason.reason}` + ); } } catch (error) { if (error instanceof Error) { diff --git a/api/src/unraid-api/unraid-file-modifier/unraid-file-modifier.spec.ts b/api/src/unraid-api/unraid-file-modifier/unraid-file-modifier.spec.ts index 2cea07f8a..ee3f7719c 100644 --- a/api/src/unraid-api/unraid-file-modifier/unraid-file-modifier.spec.ts +++ b/api/src/unraid-api/unraid-file-modifier/unraid-file-modifier.spec.ts @@ -1,16 +1,16 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { UnraidFileModifierService } from './unraid-file-modifier.service'; +import { UnraidFileModificationService } from '@app/unraid-api/unraid-file-modifier/unraid-file-modifier.service'; describe('FileModificationService', () => { - let service: UnraidFileModifierService; + let service: UnraidFileModificationService; beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ - providers: [UnraidFileModifierService], + providers: [UnraidFileModificationService], }).compile(); - service = module.get(UnraidFileModifierService); + service = module.get(UnraidFileModificationService); }); it('should be defined', () => {