mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 08:15:48 +00:00
This reverts commit 8d8dca32d8.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import LibraryDto from "Frontend/generated/org/gameyfin/app/libraries/dto/LibraryDto";
|
||||
import React from "react";
|
||||
import GameDto from "Frontend/generated/org/gameyfin/app/games/dto/GameDto";
|
||||
import {useSnapshot} from "valtio/react";
|
||||
import {gameState} from "Frontend/state/GameState";
|
||||
import IconBackgroundPattern from "Frontend/components/general/IconBackgroundPattern";
|
||||
@@ -16,9 +17,7 @@ export default function LibraryHeader({library, className}: LibraryHeaderProps)
|
||||
const randomGames = getRandomGames();
|
||||
|
||||
function getRandomGames() {
|
||||
if (!state.randomlyOrderedGamesByLibraryId[library.id]) return [];
|
||||
const games = state.randomlyOrderedGamesByLibraryId[library.id]
|
||||
.filter(game => game.images && game.images.length > 0);
|
||||
const games = state.randomlyOrderedGamesByLibraryId[library.id] as GameDto[];
|
||||
if (!games) return [];
|
||||
return games.slice(0, MAX_COVER_COUNT);
|
||||
}
|
||||
@@ -37,7 +36,7 @@ export default function LibraryHeader({library, className}: LibraryHeaderProps)
|
||||
}}
|
||||
>
|
||||
<img
|
||||
src={`/images/screenshot/${game.images![0].id}`}
|
||||
src={`/images/screenshot/${game.imageIds![0]}`}
|
||||
alt={`Image ${idx}`}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user