@runnerpro/backend 1.12.23 → 1.12.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -326,7 +326,8 @@ const sendFile = (req, res, { sendNotification, firebaseMessaging, isClient, buc
|
|
|
326
326
|
}
|
|
327
327
|
});
|
|
328
328
|
const getThumbnailFromVideo = (videoPath, duration) => __awaiter(void 0, void 0, void 0, function* () {
|
|
329
|
-
const
|
|
329
|
+
const targetWidth = 500;
|
|
330
|
+
const targetHeight = 400;
|
|
330
331
|
const quality = 2;
|
|
331
332
|
const tempDir = path_1.default.join('./uploads');
|
|
332
333
|
const outputFilename = `thumbnail_${Date.now()}.png`;
|
|
@@ -335,13 +336,16 @@ const getThumbnailFromVideo = (videoPath, duration) => __awaiter(void 0, void 0,
|
|
|
335
336
|
const timestamp = Math.min(Math.max(duration * 0.1, 1), 10);
|
|
336
337
|
return new Promise((resolve, reject) => {
|
|
337
338
|
(0, fluent_ffmpeg_1.default)(videoPath)
|
|
338
|
-
.
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
339
|
+
.seekInput(timestamp)
|
|
340
|
+
.outputOptions([
|
|
341
|
+
'-vf',
|
|
342
|
+
`scale=${targetWidth}:${targetHeight}:force_original_aspect_ratio=increase,crop=${targetWidth}:${targetHeight}`,
|
|
343
|
+
'-vframes',
|
|
344
|
+
'1',
|
|
345
|
+
'-f',
|
|
346
|
+
'image2',
|
|
347
|
+
])
|
|
348
|
+
.output(outputPath)
|
|
345
349
|
.on('end', () => {
|
|
346
350
|
try {
|
|
347
351
|
// Leer el archivo como buffer
|
|
@@ -366,7 +370,8 @@ const getThumbnailFromVideo = (videoPath, duration) => __awaiter(void 0, void 0,
|
|
|
366
370
|
console.error('Error limpiando archivo temporal:', cleanupError);
|
|
367
371
|
}
|
|
368
372
|
reject(error);
|
|
369
|
-
})
|
|
373
|
+
})
|
|
374
|
+
.run();
|
|
370
375
|
});
|
|
371
376
|
});
|
|
372
377
|
const getVideoDuration = (videoPath) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAuBpD,CAAC;
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAuBpD,CAAC;AAkbF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|