This commit is contained in:
@@ -56,32 +56,32 @@ public class MonitoringSearchService {
|
||||
try {
|
||||
tariffInfoService.writeOffTokens(monitoring.getUserId(), tariffMonitoring.getTokens());
|
||||
|
||||
// String yandexResponse = searchImageService.searchReverseByPublicUrl(
|
||||
// monitoring.getFile(), "yandex_reverse_image", "visual_matches");
|
||||
String yandexResponse = searchImageService.searchReverseByPublicUrl(
|
||||
monitoring.getFile(), "yandex_reverse_image", "visual_matches");
|
||||
|
||||
// List<YandexSearchResponse.ImageResult> yandexImages =
|
||||
// searchImageService.getAllImagesWithoutPagination(yandexResponse, "visual_matches");
|
||||
//
|
||||
// for (YandexSearchResponse.ImageResult imageResult : yandexImages) {
|
||||
// violationService.processViolation(imageResult, monitoring.getFile(), null);
|
||||
// }
|
||||
List<YandexSearchResponse.ImageResult> yandexImages =
|
||||
searchImageService.getAllImagesWithoutPagination(yandexResponse, "visual_matches");
|
||||
|
||||
try {
|
||||
String googleResponse = searchImageService.searchReverseByPublicUrl(
|
||||
monitoring.getFile(), "google_lens", "exact_matches");
|
||||
|
||||
List<YandexSearchResponse.ImageResult> googleImages =
|
||||
searchImageService.getAllImagesWithoutPagination(googleResponse, "exact_matches");
|
||||
|
||||
|
||||
for (YandexSearchResponse.ImageResult imageResult : googleImages) {
|
||||
violationService.processViolation(imageResult, monitoring.getFile(), null);
|
||||
}
|
||||
|
||||
} catch (TimeoutException | IOException e) {
|
||||
log.warn("Google search failed");
|
||||
for (YandexSearchResponse.ImageResult imageResult : yandexImages) {
|
||||
violationService.processViolation(imageResult, monitoring.getFile(), null);
|
||||
}
|
||||
|
||||
// try {
|
||||
// String googleResponse = searchImageService.searchReverseByPublicUrl(
|
||||
// monitoring.getFile(), "google_lens", "exact_matches");
|
||||
//
|
||||
// List<YandexSearchResponse.ImageResult> googleImages =
|
||||
// searchImageService.getAllImagesWithoutPagination(googleResponse, "exact_matches");
|
||||
//
|
||||
//
|
||||
// for (YandexSearchResponse.ImageResult imageResult : googleImages) {
|
||||
// violationService.processViolation(imageResult, monitoring.getFile(), null);
|
||||
// }
|
||||
//
|
||||
// } catch (TimeoutException | IOException e) {
|
||||
// log.warn("Google search failed");
|
||||
// }
|
||||
|
||||
monitoring.setLastRunStatus("SUCCESS");
|
||||
} catch (TariffNotFoundException e) {
|
||||
User user = userRepository.findById(monitoring.getUserId()).orElseThrow();
|
||||
|
||||
Reference in New Issue
Block a user