This commit is contained in:
@@ -50,9 +50,9 @@ public class ImageFoundRequestHandler implements RequestHandler {
|
|||||||
Map.of("fileId",fileId)));
|
Map.of("fileId",fileId)));
|
||||||
});
|
});
|
||||||
|
|
||||||
// String searchResponseYandex;
|
String searchResponseYandex;
|
||||||
String searchResponseGoogle;
|
String searchResponseGoogle;
|
||||||
// List<YandexSearchResponse.ImageResult> allYandexImages = new ArrayList<>();
|
List<YandexSearchResponse.ImageResult> allYandexImages = new ArrayList<>();
|
||||||
List<YandexSearchResponse.ImageResult> allGoogleImages = new ArrayList<>();
|
List<YandexSearchResponse.ImageResult> allGoogleImages = new ArrayList<>();
|
||||||
List<YandexSearchResponse.ImageResult> allUniqueImages;
|
List<YandexSearchResponse.ImageResult> allUniqueImages;
|
||||||
boolean hasTimeout = false;
|
boolean hasTimeout = false;
|
||||||
@@ -70,7 +70,7 @@ public class ImageFoundRequestHandler implements RequestHandler {
|
|||||||
log.error("Google search failed for file {}", fileId, e);
|
log.error("Google search failed for file {}", fileId, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// /*
|
||||||
try {
|
try {
|
||||||
searchResponseYandex = searchImageService.searchReverseByPublicUrl(fileEntity, "yandex_reverse_image",
|
searchResponseYandex = searchImageService.searchReverseByPublicUrl(fileEntity, "yandex_reverse_image",
|
||||||
"visual_matches");
|
"visual_matches");
|
||||||
@@ -83,10 +83,11 @@ public class ImageFoundRequestHandler implements RequestHandler {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error("Yandex search failed for file {}", fileId, e);
|
log.error("Yandex search failed for file {}", fileId, e);
|
||||||
}
|
}
|
||||||
*/
|
// */
|
||||||
|
|
||||||
// allUniqueImages = searchImageService.removeDuplicateUrls(allYandexImages, allGoogleImages);
|
// allUniqueImages = searchImageService.removeDuplicateUrls(allYandexImages, allGoogleImages);
|
||||||
allUniqueImages = allGoogleImages;
|
// allUniqueImages = allGoogleImages;
|
||||||
|
allUniqueImages = allYandexImages;
|
||||||
log.info("allUniqueImages OK: {} images", allUniqueImages.size());
|
log.info("allUniqueImages OK: {} images", allUniqueImages.size());
|
||||||
|
|
||||||
tariffInfoService.writeOffTokens(fileEntity.getUserId(), TariffConstants.TOKEN_VALUE_FOR_SEARCH);
|
tariffInfoService.writeOffTokens(fileEntity.getUserId(), TariffConstants.TOKEN_VALUE_FOR_SEARCH);
|
||||||
|
|||||||
Reference in New Issue
Block a user