[server] only provide games that exist in games folder
This commit is contained in:
		| @@ -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 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user