mirror of
https://github.com/grimsi/gameyfin.git
synced 2026-02-06 11:27:07 +00:00
Fix getGameByIt
This commit is contained in:
parent
4811681f05
commit
19c3d2d3ce
@ -129,7 +129,7 @@ class SteamGridDbPlugin(wrapper: PluginWrapper) : ConfigurableGameyfinPlugin(wra
|
||||
|
||||
val gameDetails = client.game(gameId)
|
||||
|
||||
return gameDetails.data?.firstOrNull()
|
||||
return gameDetails.data
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package de.grimsi.gameyfinplugins.steamgriddb.api
|
||||
|
||||
import de.grimsi.gameyfinplugins.steamgriddb.dto.SteamGridDbGameResult
|
||||
import de.grimsi.gameyfinplugins.steamgriddb.dto.SteamGridDbGridResult
|
||||
import de.grimsi.gameyfinplugins.steamgriddb.dto.SteamGridDbSearchResult
|
||||
import io.ktor.client.*
|
||||
@ -51,7 +52,7 @@ class SteamGridDbApiClient(private val apiKey: String) {
|
||||
}.body()
|
||||
}
|
||||
|
||||
suspend fun game(gameId: Int, block: HttpRequestBuilder.() -> Unit = {}): SteamGridDbSearchResult {
|
||||
suspend fun game(gameId: Int, block: HttpRequestBuilder.() -> Unit = {}): SteamGridDbGameResult {
|
||||
return get("games/id/$gameId", block).body()
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
package de.grimsi.gameyfinplugins.steamgriddb.dto
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
|
||||
@Serializable
|
||||
data class SteamGridDbGame(
|
||||
val id: Int,
|
||||
val name: String
|
||||
)
|
||||
@ -0,0 +1,9 @@
|
||||
package de.grimsi.gameyfinplugins.steamgriddb.dto
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class SteamGridDbGameResult(
|
||||
val success: Boolean,
|
||||
val data: SteamGridDbGame?
|
||||
)
|
||||
@ -6,10 +6,4 @@ import kotlinx.serialization.Serializable
|
||||
data class SteamGridDbSearchResult(
|
||||
val success: Boolean,
|
||||
val data: List<SteamGridDbGame>?
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class SteamGridDbGame(
|
||||
val id: Int,
|
||||
val name: String
|
||||
)
|
||||
Loading…
Reference in New Issue
Block a user