Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Models-AdditionalData: Use String instead of Enum
Browse files Browse the repository at this point in the history
There so many unknown types, so it's better to use raw string value
  • Loading branch information
DareFox committed Aug 22, 2022
1 parent 87a83f5 commit 1abd4fc
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions src/main/kotlin/kmtt/models/AdditionalData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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()
}
}

0 comments on commit 1abd4fc

Please sign in to comment.