dev add check hash for all types,exclude video
Test Workflow / test (push) Successful in 4s

This commit is contained in:
vladp
2026-02-16 16:15:15 +07:00
parent 27705c5739
commit d74571b7cb
2 changed files with 2 additions and 2 deletions
@@ -56,7 +56,7 @@ public class FileEntityService {
Map<String, Long> imageHash = Map.of(); Map<String, Long> imageHash = Map.of();
if (!session.getFileType().startsWith("video")) { if (session.getFileType().startsWith("image")) {
imageHash = imageHashService.calculateHash(filePath); imageHash = imageHashService.calculateHash(filePath);
List<SimilarImageProjection> duplicatedByHash = fileSimilarityService.findDuplicatedByHash( List<SimilarImageProjection> duplicatedByHash = fileSimilarityService.findDuplicatedByHash(
imageHash.get("hi"), imageHash.get("low")); imageHash.get("hi"), imageHash.get("low"));
@@ -240,7 +240,7 @@ public class FileUploadServiceImpl implements FileUploadService {
FileEntity saved = fileEntityRepository.save(fileEntity); FileEntity saved = fileEntityRepository.save(fileEntity);
if (!session.getFileType().equals("video")) { if (session.getFileType().equals("image")) {
Map<String, Long> hash = imageHashService.calculateHash(filePath); Map<String, Long> hash = imageHashService.calculateHash(filePath);
imageHashService.create(saved, hash); imageHashService.create(saved, hash);