Compare commits

...

2 Commits

Author SHA1 Message Date
1dd25f682b
[server] only provide games that exist in games folder 2024-11-15 12:15:50 +01:00
3610eb77a6
[ui] show size in GB 2024-11-15 12:10:02 +01:00
2 changed files with 12 additions and 1 deletions

View File

@ -319,6 +319,17 @@ async fn main() -> eyre::Result<()> {
let eti_games = eti::get_games(&cli.db).await?; let eti_games = eti::get_games(&cli.db).await?;
let mut games: Vec<Game> = eti_games.into_iter().map(eti_game_to_game).collect(); let mut games: Vec<Game> = eti_games.into_iter().map(eti_game_to_game).collect();
// Filter games based on existing folders
games.retain(|game| {
let game_folder = cli.folder.join(&game.id);
let exists = game_folder.exists() && game_folder.is_dir();
if !exists {
tracing::debug!("Skipping game {}: folder not found", game.id);
}
exists
});
let thumbnails = Thumbnails::new(cli.thumbnails); let thumbnails = Thumbnails::new(cli.thumbnails);
// add thumbnails to games // add thumbnails to games

View File

@ -226,7 +226,7 @@ const App = () => {
<div className="item-name">{item.name}</div> <div className="item-name">{item.name}</div>
<div className="description"> <div className="description">
<span className="desc-text">{item.description.slice(0, 10)}</span> <span className="desc-text">{item.description.slice(0, 10)}</span>
<span className="size-text">{item.size.toString()}</span> <span className="size-text">{(item.size / 1024 / 1024 / 1024).toFixed(1)} GB</span>
</div> </div>
<div className="play-button" <div className="play-button"
onClick={() => item.installed onClick={() => item.installed