dev add cold storage
Test Workflow / test (push) Has been cancelled

This commit is contained in:
2026-04-23 12:37:14 +07:00
parent 33c0275a37
commit 2f167a0150
2 changed files with 6 additions and 6 deletions
@@ -109,15 +109,15 @@ public class FileSimilarityService {
}
public void hasDuplicatesByHash(String path, String mimeType, Long userId) throws Exception {
FileEntity duplicateByHash = findDuplicateByHash(path, mimeType, userId);
FileEntity duplicateByHash = findDuplicateByHash(path, mimeType, userId, false);
if (duplicateByHash != null) {
throw new DuplicateImageException("Duplicate", duplicateByHash.getId(),
duplicateByHash.getUserId());
}
}
public FileEntity findDuplicateByHash(String path, String mimeType, Long userId) throws Exception {
String hash = calculateFileHash(path, false);
public FileEntity findDuplicateByHash(String path, String mimeType, Long userId, boolean cloud) throws Exception {
String hash = calculateFileHash(path, cloud);
User user = userRepository.findById(userId).orElseThrow();
Company company = user.getCompany();