From 1abd4fcc807d9a1e0058f59afc273f82c4a33be4 Mon Sep 17 00:00:00 2001 From: darefox Date: Mon, 22 Aug 2022 16:29:42 +0300 Subject: [PATCH] Models-AdditionalData: Use String instead of Enum There so many unknown types, so it's better to use raw string value --- src/main/kotlin/kmtt/models/AdditionalData.kt | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/main/kotlin/kmtt/models/AdditionalData.kt b/src/main/kotlin/kmtt/models/AdditionalData.kt index 1d2abc46..6e76b8c3 100644 --- a/src/main/kotlin/kmtt/models/AdditionalData.kt +++ b/src/main/kotlin/kmtt/models/AdditionalData.kt @@ -28,9 +28,8 @@ import kotlinx.serialization.json.JsonNames @OptIn(ExperimentalSerializationApi::class) @kotlinx.serialization.Serializable data class AdditionalData( - @JsonNames("type") - val type: kmtt.models.AdditionalData.Type? = null, + val type: String? = null, @JsonNames("url") val url: String? = null, @@ -48,23 +47,5 @@ data class AdditionalData( val hasAudio: Boolean? = null, ) { - - /** - * Type of media file - */ - @OptIn(ExperimentalSerializationApi::class) - @kotlinx.serialization.Serializable - enum class Type() { - @JsonNames("gif") - GIF(), - @JsonNames("jpg", "jpeg") - JPG(), - @JsonNames("png") - PNG(), - @JsonNames("webp") - WEBP(), - @JsonNames("mp4") - MP4() - } }