diff --git a/src/main/kotlin/dev/usbharu/hideout/config/MvcConfigurer.kt b/src/main/kotlin/dev/usbharu/hideout/config/MvcConfigurer.kt index 6e14270c..d6afcfe6 100644 --- a/src/main/kotlin/dev/usbharu/hideout/config/MvcConfigurer.kt +++ b/src/main/kotlin/dev/usbharu/hideout/config/MvcConfigurer.kt @@ -15,7 +15,6 @@ class MvcConfigurer(private val jsonOrFormModelMethodProcessor: JsonOrFormModelM } } - @Configuration class JsonOrFormModelMethodProcessorConfig { @Bean diff --git a/src/main/kotlin/dev/usbharu/hideout/config/SpringConfig.kt b/src/main/kotlin/dev/usbharu/hideout/config/SpringConfig.kt index cb66bde2..18ee3845 100644 --- a/src/main/kotlin/dev/usbharu/hideout/config/SpringConfig.kt +++ b/src/main/kotlin/dev/usbharu/hideout/config/SpringConfig.kt @@ -7,7 +7,6 @@ import org.springframework.context.annotation.Configuration import org.springframework.web.filter.CommonsRequestLoggingFilter import java.net.URL - @Configuration class SpringConfig { diff --git a/src/main/kotlin/dev/usbharu/hideout/domain/model/ap/Document.kt b/src/main/kotlin/dev/usbharu/hideout/domain/model/ap/Document.kt index 693c6405..0c4ac36f 100644 --- a/src/main/kotlin/dev/usbharu/hideout/domain/model/ap/Document.kt +++ b/src/main/kotlin/dev/usbharu/hideout/domain/model/ap/Document.kt @@ -21,7 +21,6 @@ class Document : Object { this.url = url } - override fun equals(other: Any?): Boolean { if (this === other) return true if (other !is Document) return false @@ -43,6 +42,4 @@ class Document : Object { override fun toString(): String { return "Document(mediaType=$mediaType, url=$url) ${super.toString()}" } - - } diff --git a/src/main/kotlin/dev/usbharu/hideout/domain/model/ap/Note.kt b/src/main/kotlin/dev/usbharu/hideout/domain/model/ap/Note.kt index 7ca19a0d..caba5383 100644 --- a/src/main/kotlin/dev/usbharu/hideout/domain/model/ap/Note.kt +++ b/src/main/kotlin/dev/usbharu/hideout/domain/model/ap/Note.kt @@ -40,7 +40,6 @@ open class Note : Object { this.attachment = attachment } - override fun equals(other: Any?): Boolean { if (this === other) return true if (other !is Note) return false @@ -74,6 +73,4 @@ open class Note : Object { override fun toString(): String { return "Note(attributedTo=$attributedTo, attachment=$attachment, content=$content, published=$published, to=$to, cc=$cc, sensitive=$sensitive, inReplyTo=$inReplyTo) ${super.toString()}" } - - } diff --git a/src/main/kotlin/dev/usbharu/hideout/domain/model/mastodon/StatusesRequest.kt b/src/main/kotlin/dev/usbharu/hideout/domain/model/mastodon/StatusesRequest.kt index d82a8bad..0deca5a8 100644 --- a/src/main/kotlin/dev/usbharu/hideout/domain/model/mastodon/StatusesRequest.kt +++ b/src/main/kotlin/dev/usbharu/hideout/domain/model/mastodon/StatusesRequest.kt @@ -60,7 +60,6 @@ class StatusesRequest { return result } - override fun toString(): String { return "StatusesRequest(status=$status, mediaIds=$media_ids, poll=$poll, inReplyToId=$in_reply_to_id, sensitive=$sensitive, spoilerText=$spoiler_text, visibility=$visibility, language=$language, scheduledAt=$scheduled_at)" } diff --git a/src/main/kotlin/dev/usbharu/hideout/query/mastodon/StatusQueryServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/query/mastodon/StatusQueryServiceImpl.kt index 155b3bd5..7b045508 100644 --- a/src/main/kotlin/dev/usbharu/hideout/query/mastodon/StatusQueryServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/query/mastodon/StatusQueryServiceImpl.kt @@ -27,7 +27,6 @@ class StatusQueryServiceImpl : StatusQueryService { return resolveReplyAndRepost(pairs) } - private fun resolveReplyAndRepost(pairs: List>): List { val statuses = pairs.map { it.first } return pairs @@ -56,25 +55,27 @@ class StatusQueryServiceImpl : StatusQueryService { .groupBy { it[Posts.id] } .map { it.value } .map { - toStatus(it.first()).copy(mediaAttachments = it.map { - it.toMedia().let { - MediaAttachment( - it.id.toString(), - when (it.type) { - FileType.Image -> MediaAttachment.Type.image - FileType.Video -> MediaAttachment.Type.video - FileType.Audio -> MediaAttachment.Type.audio - FileType.Unknown -> MediaAttachment.Type.unknown - }, - it.url, - it.thumbnailUrl, - it.remoteUrl, - "", - it.blurHash, - it.url - ) + toStatus(it.first()).copy( + mediaAttachments = it.map { + it.toMedia().let { + MediaAttachment( + it.id.toString(), + when (it.type) { + FileType.Image -> MediaAttachment.Type.image + FileType.Video -> MediaAttachment.Type.video + FileType.Audio -> MediaAttachment.Type.audio + FileType.Unknown -> MediaAttachment.Type.unknown + }, + it.url, + it.thumbnailUrl, + it.remoteUrl, + "", + it.blurHash, + it.url + ) + } } - }) to it.first()[Posts.repostId] + ) to it.first()[Posts.repostId] } return resolveReplyAndRepost(pairs) } diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt b/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt index f95d56c6..400126ea 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt @@ -90,7 +90,6 @@ object PostsMedia : Table() { override val primaryKey = PrimaryKey(postId, mediaId) } - fun ResultRow.toPost(): Post { return Post.of( id = this[Posts.id],