Merge remote-tracking branch 'origin/feature/remote-media' into feature/remote-media

This commit is contained in:
usbharu 2023-11-02 19:58:48 +09:00
commit 61f4a49756
2 changed files with 2 additions and 5 deletions

View File

@ -126,14 +126,14 @@ class APNoteServiceImpl(
postQueryService.findByUrl(it) postQueryService.findByUrl(it)
} }
val mediaList = note.attachment val mediaList = note.attachment
.filter { it.url != null } .filter { it.url != null }
.map { .map {
mediaService.uploadRemoteMedia( mediaService.uploadRemoteMedia(
RemoteMedia( RemoteMedia(
(it.name ?: it.url)!!, (it.name ?: it.url)!!,
it.url!!, it.mediaType ?: "application/octet-stream" it.url!!,
it.mediaType ?: "application/octet-stream"
) )
) )
} }

View File

@ -95,7 +95,6 @@ class MediaServiceImpl(
) )
} }
// TODO: 仮の処理として保存したように動かす // TODO: 仮の処理として保存したように動かす
override suspend fun uploadRemoteMedia(remoteMedia: RemoteMedia): Media { override suspend fun uploadRemoteMedia(remoteMedia: RemoteMedia): Media {
logger.info("MEDIA Remote media. filename:${remoteMedia.name} url:${remoteMedia.url}") logger.info("MEDIA Remote media. filename:${remoteMedia.name} url:${remoteMedia.url}")
@ -145,7 +144,6 @@ class MediaServiceImpl(
mediaBlurhashService.generateBlurhash(ImageIO.read(bytes.inputStream())) mediaBlurhashService.generateBlurhash(ImageIO.read(bytes.inputStream()))
} }
return mediaRepository.save( return mediaRepository.save(
EntityMedia( EntityMedia(
id = mediaRepository.generateId(), id = mediaRepository.generateId(),
@ -159,7 +157,6 @@ class MediaServiceImpl(
) )
} }
companion object { companion object {
private val logger = LoggerFactory.getLogger(MediaServiceImpl::class.java) private val logger = LoggerFactory.getLogger(MediaServiceImpl::class.java)
} }