mirror of
https://github.com/InsanusMokrassar/SauceNaoAPI.git
synced 2025-12-10 06:55:48 +00:00
upmigration
This commit is contained in:
@@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user