Authored by mali

鉴定视频优化

... ... @@ -28,14 +28,10 @@ public class QiniuLiveUrlUtil {
return videoName;
}
if (StringUtils.isBlank(filename)) {
return null;
}
if (filename.startsWith("http")) { // 如果数据库存放的是绝对路径,则直接返回
return filename;
}
return makeLiveVideoUrl(filename);
}
return LIVE_VIDEO_DOMAIN + MP4_FILEKEY_PRE + filename;
public static boolean filterVideoValid(String videoName, Integer status) {
return StringUtils.isNotBlank(videoName) || 1 == status;
}
}
... ...
... ... @@ -46,12 +46,6 @@ public class QiniuLiveRecordService {
@Autowired
OrderConfigConstant orderConfigConstant;
private static boolean filterVideoValid(String videoName, Integer status) {
return StringUtils.isNotBlank(videoName) || 1 == status;
}
public void updateStatusByPersistId(String persistId, Integer code) {
if (Integer.valueOf(0).equals(code)) {
qiniuLiveRecordMapper.updateStatusByPersistId(persistId, 1); // 更新直播记录状态为已转码成功
... ... @@ -101,7 +95,7 @@ public class QiniuLiveRecordService {
LOG.info("method getAppraiseVideoUrl in qiniuLiveRecordMapper.selectByOrderCodesEx orderCodes is {}", orderCodes);
return qiniuLiveRecordMapper.selectByOrderCodesEx(orderCodes).stream()
.filter(item -> filterVideoValid(item.getVideoUrl(), item.getStatus()))
.filter(item -> QiniuLiveUrlUtil.filterVideoValid(item.getVideoUrl(), item.getStatus()))
.collect(Collectors.toMap(QiniuLiveRecord::getOrderCode, e -> QiniuLiveUrlUtil.makeLiveVideoUrl(e.getVideoUrl(), e.getVedioFileUrl()),
(o, n) -> o));
}
... ... @@ -139,7 +133,7 @@ public class QiniuLiveRecordService {
} else {
LOG.info("mthod queryOrderVideos in qiniuLiveRecordMapper.selectByProductIdEx productId is {}", productId);
qiNiuLiveRecords = qiniuLiveRecordMapper.selectByProductIdEx(productId).stream()
.filter(item -> filterVideoValid(item.getVideoUrl(), item.getStatus())).collect(Collectors.toList());
.filter(item -> QiniuLiveUrlUtil.filterVideoValid(item.getVideoUrl(), item.getStatus())).collect(Collectors.toList());
}
List<Long> orderCodeList = qiNiuLiveRecords.stream().map(QiniuLiveRecord::getOrderCode).collect(Collectors.toList());
... ...