mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-17 16:20:03 +00:00
Only request vertical covers from SteamGridDb
This commit is contained in:
+7
-1
@@ -20,6 +20,7 @@ class SteamGridDbApiClient(private val apiKey: String) {
|
|||||||
ignoreUnknownKeys = true
|
ignoreUnknownKeys = true
|
||||||
}
|
}
|
||||||
private const val BASE_URL = "https://www.steamgriddb.com/api/v2"
|
private const val BASE_URL = "https://www.steamgriddb.com/api/v2"
|
||||||
|
private const val COVER_SIZES = "600x900,342x482,660x930"
|
||||||
}
|
}
|
||||||
|
|
||||||
private val client = HttpClient(CIO) {
|
private val client = HttpClient(CIO) {
|
||||||
@@ -42,7 +43,12 @@ class SteamGridDbApiClient(private val apiKey: String) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
suspend fun grids(gameId: Int, block: HttpRequestBuilder.() -> Unit = {}): SteamGridDbGridResult {
|
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 {
|
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-Class: de.grimsi.gameyfin.plugins.steamgriddb.SteamGridDbPlugin
|
||||||
Plugin-Id: steamgriddb
|
Plugin-Id: steamgriddb
|
||||||
Plugin-Description: Steam Grid DB covers
|
Plugin-Description: Steam Grid DB covers
|
||||||
Plugin-Version: 1.0.0-alpha1
|
Plugin-Version: 1.0.0-alpha2
|
||||||
Plugin-Provider: grimsi
|
Plugin-Provider: grimsi
|
||||||
|
|||||||
Reference in New Issue
Block a user