This commit is contained in:
2025-02-14 18:18:21 +08:00
parent b4b6d93e2f
commit cfb9392068
26 changed files with 404 additions and 88 deletions

View File

@ -27,6 +27,7 @@ import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Component
@EnableScheduling
@ -139,7 +140,7 @@ public class FaceCleaner {
IStorageAdapter adapter = StorageFactory.use("assets-ext");
List<StorageFileObject> fileObjectList = adapter.listDir("video-source");
fileObjectList.parallelStream().forEach(fileObject -> {
if (list.parallelStream().noneMatch(videoRespVO -> videoRespVO.getVideoUrl().contains(fileObject.getFullPath()))){
if (list.parallelStream().filter(videoRespVO -> Objects.nonNull(videoRespVO.getVideoUrl())).noneMatch(videoRespVO -> videoRespVO.getVideoUrl().contains(fileObject.getFullPath()))){
log.info("删除视频文件:{}", fileObject);
adapter.deleteFile(fileObject.getFullPath());
} else {