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