upmigration

This commit is contained in:
2020-12-02 14:39:54 +06:00
parent 7bc1e822fc
commit f27c493771
29 changed files with 94 additions and 87 deletions

View File

@@ -0,0 +1,24 @@
package dev.inmo.saucenaoapi.additional.header
import dev.inmo.saucenaoapi.models.Header
data class IndexInfo(
val id: Int,
val status: Int = 500,
val results: Int = 0,
val parent_id: Int? = null
)
val Header.adaptedIndexes: List<IndexInfo>
get() = indexes.mapNotNull {
it ?.let { _ ->
it.id ?.let { id ->
IndexInfo(
id,
it.status ?: 500, // Serverside error if not set
it.results ?: 0,
it.parent_id
)
}
}
}