diff --git a/gameyfin/src/main/frontend/components/games/GameOverviewCard.tsx b/gameyfin/src/main/frontend/components/games/GameOverviewCard.tsx
new file mode 100644
index 0000000..5b61377
--- /dev/null
+++ b/gameyfin/src/main/frontend/components/games/GameOverviewCard.tsx
@@ -0,0 +1,15 @@
+import GameDto from "Frontend/generated/de/grimsi/gameyfin/games/dto/GameDto";
+import {Card, Image} from "@nextui-org/react";
+
+export function GameOverviewCard({game}: { game: GameDto }) {
+ return (
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/gameyfin/src/main/frontend/views/TestView.tsx b/gameyfin/src/main/frontend/views/TestView.tsx
index 800feb2..f943bcf 100644
--- a/gameyfin/src/main/frontend/views/TestView.tsx
+++ b/gameyfin/src/main/frontend/views/TestView.tsx
@@ -4,6 +4,7 @@ import {toast} from "sonner";
import {LibraryEndpoint, SystemEndpoint} from "Frontend/generated/endpoints";
import {useState} from "react";
import GameDto from "Frontend/generated/de/grimsi/gameyfin/games/dto/GameDto";
+import {GameOverviewCard} from "Frontend/components/games/GameOverviewCard";
export default function TestView() {
const [gameTitle, setGameTitle] = useState("");
@@ -54,6 +55,7 @@ export default function TestView() {
+ {game && }
{game && <>{JSON.stringify(game, null, 2)}>}
diff --git a/gameyfin/src/main/kotlin/de/grimsi/gameyfin/games/GameService.kt b/gameyfin/src/main/kotlin/de/grimsi/gameyfin/games/GameService.kt
index 6784c34..ec2f489 100644
--- a/gameyfin/src/main/kotlin/de/grimsi/gameyfin/games/GameService.kt
+++ b/gameyfin/src/main/kotlin/de/grimsi/gameyfin/games/GameService.kt
@@ -89,7 +89,7 @@ class GameService(
return GameDto(
id = gameId,
title = game.title,
- coverImageUrl = game.coverImage.contentId,
+ coverId = game.coverImage.id,
comment = game.comment,
summary = game.summary,
release = game.release,
@@ -100,7 +100,7 @@ class GameService(
keywords = game.keywords.toList(),
features = game.features.map { it.name },
perspectives = game.perspectives.map { it.name },
- images = game.images.mapNotNull { it.id },
+ imageIds = game.images.mapNotNull { it.id },
videoUrls = game.videoUrls.map { it.toString() },
source = game.source.pluginId
)
@@ -137,7 +137,7 @@ class GameService(
val image = Image(originalUrl = imageUrl, type = type)
imageUrl.openStream().use { input ->
- image.mimeType = URLConnection.guessContentTypeFromStream(input)
+ image.mimeType = URLConnection.guessContentTypeFromName(imageUrl.file)
imageContentStore.setContent(image, input)
}
return imageRepository.save(image)
diff --git a/gameyfin/src/main/kotlin/de/grimsi/gameyfin/games/dto/GameDto.kt b/gameyfin/src/main/kotlin/de/grimsi/gameyfin/games/dto/GameDto.kt
index 3e5d52f..f679b65 100644
--- a/gameyfin/src/main/kotlin/de/grimsi/gameyfin/games/dto/GameDto.kt
+++ b/gameyfin/src/main/kotlin/de/grimsi/gameyfin/games/dto/GameDto.kt
@@ -5,7 +5,7 @@ import java.time.Instant
class GameDto(
val id: Long,
val title: String,
- val coverImageUrl: String?,
+ val coverId: Long?,
val comment: String?,
val summary: String?,
val release: Instant?,
@@ -16,7 +16,7 @@ class GameDto(
val keywords: List?,
val features: List?,
val perspectives: List?,
- val images: List?,
+ val imageIds: List?,
val videoUrls: List?,
val source: String?
)
\ No newline at end of file
diff --git a/gameyfin/src/main/kotlin/de/grimsi/gameyfin/media/ImageEndpoint.kt b/gameyfin/src/main/kotlin/de/grimsi/gameyfin/media/ImageEndpoint.kt
index 38aef29..ba460fc 100644
--- a/gameyfin/src/main/kotlin/de/grimsi/gameyfin/media/ImageEndpoint.kt
+++ b/gameyfin/src/main/kotlin/de/grimsi/gameyfin/media/ImageEndpoint.kt
@@ -76,8 +76,8 @@ class ImageEndpoint(
val inputStreamResource = InputStreamResource(file)
val headers = HttpHeaders()
- headers.contentLength = image.contentLength!!
- headers.contentType = MediaType.parseMediaType(image.mimeType!!)
+ image.contentLength?.let { headers.contentLength = it }
+ image.mimeType?.let { headers.contentType = MediaType.parseMediaType(it) }
return ResponseEntity.ok()
.headers(headers)