fix(media): 修正转码任务认领与媒资 id 校验
This commit is contained in:
1 parent
ad84704d28
commit
5552caa6c1
8 files changed
+200
-101
No files matched your search
+13
-13
@@ -43,22 +43,22 @@ public class EpisodeService implements EpisodeTranscodeCompletionPort, EpisodeVi
|
||||
private final EpisodeTranscodeBindingService transcodeBindingService;
|
||||
|
||||
@Override
|
||||
public java.util.Optional<EpisodeVideoSource> resolve(Long candidateId) {
|
||||
if (candidateId == null || candidateId <= 0) {
|
||||
public java.util.Optional<EpisodeVideoSource> resolveByVideoUrl(String videoUrl) {
|
||||
if (!StringUtils.hasText(videoUrl)) {
|
||||
return java.util.Optional.empty();
|
||||
}
|
||||
DramaEpisode episode = dramaEpisodeMapper.selectById(candidateId);
|
||||
if (episode == null) {
|
||||
episode = dramaEpisodeMapper.selectOne(Wrappers.<DramaEpisode>lambdaQuery()
|
||||
.eq(DramaEpisode::getVideoAssetId, candidateId)
|
||||
.last("limit 1"));
|
||||
}
|
||||
if (episode == null) {
|
||||
return java.util.Optional.empty();
|
||||
}
|
||||
return java.util.Optional.of(new EpisodeVideoSource(
|
||||
DramaEpisode episode = dramaEpisodeMapper.selectOne(Wrappers.<DramaEpisode>lambdaQuery()
|
||||
.eq(DramaEpisode::getVideoUrl, videoUrl)
|
||||
.last("limit 1"));
|
||||
return episode == null
|
||||
? java.util.Optional.empty()
|
||||
: java.util.Optional.of(toVideoSource(episode));
|
||||
}
|
||||
|
||||
private EpisodeVideoSource toVideoSource(DramaEpisode episode) {
|
||||
return new EpisodeVideoSource(
|
||||
episode.getId(), episode.getDramaId(), episode.getVideoAssetId(),
|
||||
episode.getVideoUrl(), episode.getDurationSec()));
|
||||
episode.getVideoUrl(), episode.getDurationSec());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user