diff --git a/crates/lanspread-server/src/main.rs b/crates/lanspread-server/src/main.rs index 93036ae..8dab420 100644 --- a/crates/lanspread-server/src/main.rs +++ b/crates/lanspread-server/src/main.rs @@ -319,6 +319,17 @@ async fn main() -> eyre::Result<()> { let eti_games = eti::get_games(&cli.db).await?; let mut games: Vec = 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); // add thumbnails to games