diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/objects/note/APNoteService.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/objects/note/APNoteService.kt index dd2ec6ae..0fdee80b 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/objects/note/APNoteService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/objects/note/APNoteService.kt @@ -126,14 +126,14 @@ class APNoteServiceImpl( postQueryService.findByUrl(it) } - val mediaList = note.attachment .filter { it.url != null } .map { mediaService.uploadRemoteMedia( RemoteMedia( (it.name ?: it.url)!!, - it.url!!, it.mediaType ?: "application/octet-stream" + it.url!!, + it.mediaType ?: "application/octet-stream" ) ) } diff --git a/src/main/kotlin/dev/usbharu/hideout/core/service/media/MediaServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/core/service/media/MediaServiceImpl.kt index aefbc05e..ca0f1387 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/service/media/MediaServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/service/media/MediaServiceImpl.kt @@ -95,7 +95,6 @@ class MediaServiceImpl( ) } - // TODO: 仮の処理として保存したように動かす override suspend fun uploadRemoteMedia(remoteMedia: RemoteMedia): Media { logger.info("MEDIA Remote media. filename:${remoteMedia.name} url:${remoteMedia.url}") @@ -145,7 +144,6 @@ class MediaServiceImpl( mediaBlurhashService.generateBlurhash(ImageIO.read(bytes.inputStream())) } - return mediaRepository.save( EntityMedia( id = mediaRepository.generateId(), @@ -159,7 +157,6 @@ class MediaServiceImpl( ) } - companion object { private val logger = LoggerFactory.getLogger(MediaServiceImpl::class.java) }