mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-14 16:20:04 +00:00
Minor bugfixes in IGDB plugin
Minor bugfixes in Steam plugin
This commit is contained in:
@@ -97,7 +97,8 @@ class Mapper {
|
||||
return URI(imageBuilder(screenshot.imageId, ImageSize.FHD, ImageType.PNG))
|
||||
}
|
||||
|
||||
fun cover(cover: proto.Cover): URI {
|
||||
fun cover(cover: proto.Cover): URI? {
|
||||
if (cover.imageId.isEmpty()) return null
|
||||
return URI(imageBuilder(cover.imageId, ImageSize.COVER_BIG, ImageType.PNG))
|
||||
}
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@ Manifest-Version: 1.0
|
||||
Plugin-Class: de.grimsi.gameyfin.plugins.igdb.IgdbPlugin
|
||||
Plugin-Id: igdb
|
||||
Plugin-Description: IGDB Metadata
|
||||
Plugin-Version: 1.0.0-alpha3
|
||||
Plugin-Version: 1.0.0-alpha4
|
||||
Plugin-Provider: grimsi
|
||||
|
||||
@@ -100,19 +100,21 @@ class SteamPlugin(wrapper: PluginWrapper) : GameyfinPlugin(wrapper) {
|
||||
|
||||
val game = steamDetailsResultWrapper[id]?.data ?: return null
|
||||
|
||||
if (game.type != "game") return null
|
||||
|
||||
// This is as much as I can get from the Steam Store API
|
||||
val metadata = GameMetadata(
|
||||
originalId = id.toString(),
|
||||
title = game.name,
|
||||
description = game.detailedDescription,
|
||||
coverUrl = URI(game.headerImage),
|
||||
coverUrl = game.headerImage?.let { URI(it) },
|
||||
release = game.releaseDate?.date,
|
||||
developedBy = game.developers.toSet(),
|
||||
publishedBy = game.publishers.toSet(),
|
||||
genres = game.genres.map { Mapper.genre(it) }.toSet(),
|
||||
keywords = game.categories.mapNotNull { it.description }.toSet(),
|
||||
screenshotUrls = game.screenshots.map { URI(it.pathFull!!) }.toSet(),
|
||||
videoUrls = game.movies.map { URI(it.webm?.max!!) }.toSet()
|
||||
developedBy = game.developers?.toSet(),
|
||||
publishedBy = game.publishers?.toSet(),
|
||||
genres = game.genres?.let { it.map { Mapper.genre(it) }.toSet() },
|
||||
keywords = game.categories?.let { it.mapNotNull { it.description }.toSet() },
|
||||
screenshotUrls = game.screenshots?.let { it.map { URI(it.pathFull) }.toSet() },
|
||||
videoUrls = game.movies?.let { it.mapNotNull { it.webm?.let { URI(it.max) } }.toSet() }
|
||||
)
|
||||
|
||||
return metadata
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package de.grimsi.gameyfin.plugins.steam.dto
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Platforms(
|
||||
val windows: Boolean,
|
||||
val mac: Boolean,
|
||||
val linux: Boolean
|
||||
)
|
||||
+11
-10
@@ -13,15 +13,16 @@ data class SteamDetailsResultWrapper(
|
||||
|
||||
@Serializable
|
||||
data class SteamGameDetails(
|
||||
val type: String,
|
||||
val name: String,
|
||||
@SerialName("detailed_description") val detailedDescription: String,
|
||||
@SerialName("header_image") val headerImage: String,
|
||||
val developers: List<String>,
|
||||
val publishers: List<String>,
|
||||
val categories: List<Category>,
|
||||
val genres: List<SteamGenre>,
|
||||
val screenshots: List<Screenshot>,
|
||||
val movies: List<Movie>,
|
||||
@SerialName("detailed_description") val detailedDescription: String? = null,
|
||||
@SerialName("header_image") val headerImage: String? = null,
|
||||
val developers: List<String>? = null,
|
||||
val publishers: List<String>? = null,
|
||||
val categories: List<Category>? = null,
|
||||
val genres: List<SteamGenre>? = null,
|
||||
val screenshots: List<Screenshot>? = null,
|
||||
val movies: List<Movie>? = null,
|
||||
@SerialName("release_date") val releaseDate: ReleaseDate? = null
|
||||
)
|
||||
|
||||
@@ -41,7 +42,7 @@ data class SteamGenre(
|
||||
data class Screenshot(
|
||||
val id: Int,
|
||||
@SerialName("path_thumbnail") val pathThumbnail: String? = null,
|
||||
@SerialName("path_full") val pathFull: String? = null
|
||||
@SerialName("path_full") val pathFull: String
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@@ -57,7 +58,7 @@ data class Movie(
|
||||
@Serializable
|
||||
data class Webm(
|
||||
val `480`: String? = null,
|
||||
val max: String? = null
|
||||
val max: String
|
||||
)
|
||||
|
||||
@Serializable
|
||||
|
||||
@@ -2,5 +2,5 @@ Manifest-Version: 1.0
|
||||
Plugin-Class: de.grimsi.gameyfin.plugins.steam.SteamPlugin
|
||||
Plugin-Id: steam
|
||||
Plugin-Description: Steam Metadata
|
||||
Plugin-Version: 1.0.0-alpha4
|
||||
Plugin-Version: 1.0.0-alpha5
|
||||
Plugin-Provider: grimsi
|
||||
|
||||
Reference in New Issue
Block a user