mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 07:50:25 +00:00
style: lint
This commit is contained in:
@@ -4,7 +4,7 @@ import crypto, { randomUUID } from 'crypto';
|
||||
import util from 'util';
|
||||
import path from 'node:path';
|
||||
import * as fileType from 'file-type';
|
||||
import { solveAsyncProblem, solveProblem } from './helper';
|
||||
import { solveProblem } from './helper';
|
||||
|
||||
export function isGIF(path: string) {
|
||||
const buffer = Buffer.alloc(4);
|
||||
@@ -194,7 +194,7 @@ export async function checkUriType(Uri: string) {
|
||||
return undefined;
|
||||
}, Uri);
|
||||
if (LocalFileRet) return LocalFileRet;
|
||||
|
||||
|
||||
const OtherFileRet = await solveProblem((uri: string) => {
|
||||
//再判断是否是Http
|
||||
if (uri.startsWith('http://') || uri.startsWith('https://')) {
|
||||
@@ -217,7 +217,7 @@ export async function checkUriType(Uri: string) {
|
||||
}
|
||||
}, Uri);
|
||||
if (OtherFileRet) return OtherFileRet;
|
||||
|
||||
|
||||
return { Uri: Uri, Type: FileUriType.Unknown };
|
||||
}
|
||||
|
||||
|
||||
@@ -24,11 +24,11 @@ export async function getVideoInfo(filePath: string, logger: LogWrapper) {
|
||||
if (videoStream) {
|
||||
logger.log(`视频尺寸: ${videoStream.width}x${videoStream.height}`);
|
||||
} else {
|
||||
return reject('未找到视频流信息。');
|
||||
return reject(new Error('未找到视频流信息。'));
|
||||
}
|
||||
resolve({
|
||||
width: videoStream.width!, height: videoStream.height!,
|
||||
time: parseInt(videoStream.duration!),
|
||||
time: +(videoStream.duration ?? 10),
|
||||
format: metadata.format.format_name!,
|
||||
size,
|
||||
filePath,
|
||||
@@ -38,7 +38,7 @@ export async function getVideoInfo(filePath: string, logger: LogWrapper) {
|
||||
});
|
||||
}
|
||||
|
||||
export function checkFfmpeg(newPath: string | null = null, logger: LogWrapper): Promise<boolean> {
|
||||
export function checkFfmpeg(logger: LogWrapper,newPath: string | null = null): Promise<boolean> {
|
||||
return new Promise((resolve, reject) => {
|
||||
logger.log('开始检查ffmpeg', newPath);
|
||||
if (newPath) {
|
||||
|
||||
Reference in New Issue
Block a user