extname should support uppercase (#569)

This commit is contained in:
an-lee
2024-04-26 16:38:11 +08:00
committed by GitHub
parent 5e56235bde
commit 3d53c2dd74
2 changed files with 2 additions and 2 deletions

View File

@@ -269,7 +269,7 @@ export class Audio extends Model<Audio> {
}
// Check if file format is supported
const extname = path.extname(filePath);
const extname = path.extname(filePath).toLocaleLowerCase();
if (VideoFormats.includes(extname.split(".").pop() as string)) {
return Video.buildFromLocalFile(filePath, params);
} else if (!AudioFormats.includes(extname.split(".").pop() as string)) {

View File

@@ -285,7 +285,7 @@ export class Video extends Model<Video> {
}
// Check if file format is supported
const extname = path.extname(filePath);
const extname = path.extname(filePath).toLocaleLowerCase();
if (AudioFormats.includes(extname.split(".").pop() as string)) {
return Audio.buildFromLocalFile(filePath, params);
} else if (!VideoFormats.includes(extname.split(".").pop() as string)) {