Revert "Overhaul startpage (#821)" (#822)

This reverts commit 8d8dca32d8.
This commit is contained in:
Simon
2025-12-10 00:24:32 +01:00
committed by GitHub
parent 8d8dca32d8
commit 608a0b5ac1
137 changed files with 810 additions and 5219 deletions
@@ -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>