fix: video name

This commit is contained in:
手瓜一十雪 committed 2024-09-13 17:38:11 +08:00
1 parent a136b2957d
commit 24a41526cb
1 file changed
+2 -1
+2 -1
View File
@@ -197,11 +197,12 @@ export class NTQQFileApi {
thumbPath.set(0, _thumbPath); thumbPath.set(0, _thumbPath);
const thumbMd5 = _thumbPath ? await calculateFileMD5(_thumbPath) : ''; const thumbMd5 = _thumbPath ? await calculateFileMD5(_thumbPath) : '';
context.deleteAfterSentFiles.push(path); context.deleteAfterSentFiles.push(path);
const uploadName = (fileName || _fileName).toLocaleLowerCase().endsWith('.' + fileExt.toLocaleLowerCase()) ? (fileName || _fileName) : (fileName || _fileName) + '.' + fileExt;
return { return {
elementType: ElementType.VIDEO, elementType: ElementType.VIDEO,
elementId: '', elementId: '',
videoElement: { videoElement: {
fileName: (fileName || _fileName).replace(/\.[^/.]+$/, '.mp4'), fileName: uploadName,
filePath: path, filePath: path,
videoMd5: md5, videoMd5: md5,
thumbMd5, thumbMd5,