Room tag: let the tag order be anything to avoid breaking at the moment.
This commit is contained in:
parent
9cc2cf8360
commit
ca890e1ef4
|
@ -21,5 +21,5 @@ import com.squareup.moshi.JsonClass
|
||||||
|
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
data class RoomTagContent(
|
data class RoomTagContent(
|
||||||
@Json(name = "tags") val tags: Map<String, Map<String, Double>> = emptyMap()
|
@Json(name = "tags") val tags: Map<String, Map<String, Any>> = emptyMap()
|
||||||
)
|
)
|
||||||
|
|
|
@ -32,8 +32,9 @@ internal class RoomTagHandler {
|
||||||
val tags = ArrayList<RoomTagEntity>()
|
val tags = ArrayList<RoomTagEntity>()
|
||||||
for (tagName in content.tags.keys) {
|
for (tagName in content.tags.keys) {
|
||||||
val params = content.tags[tagName]
|
val params = content.tags[tagName]
|
||||||
val tag = if (params != null) {
|
val order = params?.get("order")
|
||||||
RoomTagEntity(tagName, params["order"])
|
val tag = if (order is Double) {
|
||||||
|
RoomTagEntity(tagName, order)
|
||||||
} else {
|
} else {
|
||||||
RoomTagEntity(tagName, null)
|
RoomTagEntity(tagName, null)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue