fix: 取消获取视频时长
parent
8833a1d575
commit
9dbb5322ef
|
|
@ -61,6 +61,7 @@ public class FileUploadExecutor implements FileUploadApi {
|
||||||
if (file == null || file.isEmpty()) {
|
if (file == null || file.isEmpty()) {
|
||||||
throw new BizException(ErrorCode.FILE_UPLOAD_EMPTY);
|
throw new BizException(ErrorCode.FILE_UPLOAD_EMPTY);
|
||||||
}
|
}
|
||||||
|
// 获取视频时长, 暂时不获取, 直接上传
|
||||||
if (!VideoDurationHelper.isVideo(file)) {
|
if (!VideoDurationHelper.isVideo(file)) {
|
||||||
return doUpload(file, true);
|
return doUpload(file, true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,15 +40,16 @@ final class VideoDurationHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean isVideo(MultipartFile file) {
|
static boolean isVideo(MultipartFile file) {
|
||||||
if (file == null) {
|
return false;
|
||||||
return false;
|
// if (file == null) {
|
||||||
}
|
// return false;
|
||||||
String contentType = file.getContentType();
|
// }
|
||||||
if (StringUtils.hasText(contentType) && contentType.toLowerCase(Locale.ROOT).startsWith("video/")) {
|
// String contentType = file.getContentType();
|
||||||
return true;
|
// if (StringUtils.hasText(contentType) && contentType.toLowerCase(Locale.ROOT).startsWith("video/")) {
|
||||||
}
|
// return true;
|
||||||
String ext = extractExt(file.getOriginalFilename());
|
// }
|
||||||
return ext != null && VIDEO_EXTS.contains(ext);
|
// String ext = extractExt(file.getOriginalFilename());
|
||||||
|
// return ext != null && VIDEO_EXTS.contains(ext);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Path copyToTemp(MultipartFile file) throws IOException {
|
static Path copyToTemp(MultipartFile file) throws IOException {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue