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