Only request vertical covers from SteamGridDb

This commit is contained in:
grimsi
2025-05-11 12:05:03 +02:00
parent 355cfcbe65
commit 02f1a766be
2 changed files with 8 additions and 2 deletions
@@ -20,6 +20,7 @@ class SteamGridDbApiClient(private val apiKey: String) {
ignoreUnknownKeys = true
}
private const val BASE_URL = "https://www.steamgriddb.com/api/v2"
private const val COVER_SIZES = "600x900,342x482,660x930"
}
private val client = HttpClient(CIO) {
@@ -42,7 +43,12 @@ class SteamGridDbApiClient(private val apiKey: String) {
}
suspend fun grids(gameId: Int, block: HttpRequestBuilder.() -> Unit = {}): SteamGridDbGridResult {
return get("grids/game/$gameId", block).body()
return get("grids/game/$gameId") {
url {
parameters.append("dimensions", COVER_SIZES)
}
block()
}.body()
}
private suspend fun get(endpoint: String, block: HttpRequestBuilder.() -> Unit = {}): HttpResponse {
@@ -2,5 +2,5 @@ Manifest-Version: 1.0
Plugin-Class: de.grimsi.gameyfin.plugins.steamgriddb.SteamGridDbPlugin
Plugin-Id: steamgriddb
Plugin-Description: Steam Grid DB covers
Plugin-Version: 1.0.0-alpha1
Plugin-Version: 1.0.0-alpha2
Plugin-Provider: grimsi