fix: video name

This commit is contained in:
手瓜一十雪 2024-09-13 17:38:11 +08:00
parent 5f80058f70
commit df4f42e79e

View File

@ -155,7 +155,7 @@ export class NTQQFileApi {
} catch (e) {
this.context.logger.logError('获取文件类型失败', e);
}
const newFilePath = filePath + '.'+fileExt;
const newFilePath = filePath + '.' + fileExt;
fs.copyFileSync(filePath, newFilePath);
context.deleteAfterSentFiles.push(newFilePath);
filePath = newFilePath;
@ -197,11 +197,12 @@ export class NTQQFileApi {
thumbPath.set(0, _thumbPath);
const thumbMd5 = _thumbPath ? await calculateFileMD5(_thumbPath) : '';
context.deleteAfterSentFiles.push(path);
const uploadName = (fileName || _fileName).toLocaleLowerCase().endsWith('.' + fileExt.toLocaleLowerCase()) ? (fileName || _fileName) : (fileName || _fileName) + '.' + fileExt;
return {
elementType: ElementType.VIDEO,
elementId: '',
videoElement: {
fileName: (fileName || _fileName).replace(/\.[^/.]+$/, '.mp4'),
fileName: uploadName,
filePath: path,
videoMd5: md5,
thumbMd5,