Compare commits

..

1 Commits

Author SHA1 Message Date
f955671b8a feat: content service 2026-03-18 15:38:07 -03:00
3 changed files with 9 additions and 1 deletions

View File

@ -16,6 +16,7 @@ public class MangaContentImageUpdateConsumer {
@RabbitListener(queues = "${queues.manga-content-image-update}")
public void receiveMangaContentImageUpdateCommand(ImageUpdateCommand command) {
log.info("Received manga content image update command: {}", command);
contentIngestService.updateMangaContentImage(command.entityId(), command.imageId());
}
}

View File

@ -1,5 +1,7 @@
package com.magamochi.content.service;
import static java.util.Objects.isNull;
import com.magamochi.catalog.service.LanguageService;
import com.magamochi.catalog.service.MangaContentProviderService;
import com.magamochi.common.exception.NotFoundException;
@ -94,6 +96,11 @@ public class ContentIngestService {
@Transactional
public void updateMangaContentImage(long mangaContentImageId, UUID imageId) {
if (isNull(imageId)) {
log.error("Null imageID received!");
return;
}
var mangaContentImage =
mangaContentImageRepository
.findById(mangaContentImageId)

View File

@ -30,7 +30,7 @@ public class ImageFetchService {
public UUID fetchImage(String imageUrl, ContentType contentType) {
try {
var request = HttpRequest.newBuilder(URI.create(imageUrl)).GET().build();
var request = HttpRequest.newBuilder(URI.create(imageUrl.trim())).GET().build();
imageDownloadRateLimiter.acquire();
var response = httpClient.send(request, HttpResponse.BodyHandlers.ofByteArray());