dev delete config
Test Workflow / test (push) Waiting to run

This commit is contained in:
vladp
2026-02-17 14:42:58 +07:00
parent 77bf7ea886
commit 8de13b410b
2 changed files with 37 additions and 13 deletions
@@ -152,17 +152,17 @@ public class FileSimilarityService {
return duplicates;
}
public void hasDuplicatesByHash(String path, Long userId, String mimeType) throws Exception {
String hash = calculateFileHash(path);
List<FileEntity> fileEntityList = fileEntityRepository.findByUserIdAndMimeType(userId, mimeType);
for (FileEntity file : fileEntityList) {
if (calculateFileHash(file.getFilePath()).equals(hash)) {
throw new DuplicateImageException("Duplicate", file.getId(),
file.getUserId());
}
}
}
// public void hasDuplicatesByHash(String path, Long userId, String mimeType) throws Exception {
// String hash = calculateFileHash(path);
// List<FileEntity> fileEntityList = fileEntityRepository.findByUserIdAndMimeType(userId, mimeType);
//
// for (FileEntity file : fileEntityList) {
// if (calculateFileHash(file.getFilePath()).equals(hash)) {
// throw new DuplicateImageException("Duplicate", file.getId(),
// file.getUserId());
// }
// }
// }
// public Page<SimilarFileDTO> findSimilarFiles(String fileId, SimilarityFilter filter, Pageable pageable,
// String authToken) throws Exception {