mirror of https://github.com/usbharu/Hideout.git
Merge remote-tracking branch 'origin/feature/remote-media' into feature/remote-media
This commit is contained in:
commit
61f4a49756
|
@ -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"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue