import fs dep at file level

This commit is contained in:
PrivateGER 2025-05-30 18:00:12 +02:00
parent 7ce8d0de44
commit 8948369a1b
No known key found for this signature in database

View file

@ -23,6 +23,7 @@ const supportedMimeTypes = new Map([
['video/m4v', 'mp4'],
['video/quicktime', 'mov'],
]);
const fs = await import('node:fs/promises');
@Injectable()
export class VideoProcessingService {
@ -105,7 +106,6 @@ export class VideoProcessingService {
.on('end', async () => {
try {
// Replace original file with optimized version
const fs = await import('node:fs/promises');
await fs.copyFile(tempPath, source);
this.logger.info(`Web-optimized video: ${source}`);
resolve();