From ef59e92ebc057f1225afaadb295e067e3995d376 Mon Sep 17 00:00:00 2001 From: mtkennerly Date: Tue, 19 Nov 2024 20:53:47 -0500 Subject: [PATCH] Ignore games with blank title --- CHANGELOG.md | 4 ++++ src/resource/config.rs | 4 +++- src/resource/manifest.rs | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0525612..1456bea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,10 @@ the visible games would be backed up or restored even if they were disabled. * GUI: When performing a multi-game scan on the restore screen with a filter active, the scan would exclude games that were disabled for backup rather than disabled for restore. + * Ludusavi would try to scan games (custom or from secondary manifest) with a blank title. + In the GUI, they would be omitted from the results, + while on the CLI, they would be reported without a title. + Now such games are ignored when scanning. ## v0.26.0 (2024-10-29) diff --git a/src/resource/config.rs b/src/resource/config.rs index 1f52a66..53e6f22 100644 --- a/src/resource/config.rs +++ b/src/resource/config.rs @@ -1601,7 +1601,9 @@ impl Config { } pub fn is_custom_game_individually_scannable(&self, index: usize) -> bool { - self.is_custom_game_enabled(index) && self.custom_games[index].kind() == CustomGameKind::Game + self.is_custom_game_enabled(index) + && self.custom_games[index].kind() == CustomGameKind::Game + && !self.custom_games[index].name.trim().is_empty() } pub fn are_all_custom_games_enabled(&self) -> bool { diff --git a/src/resource/manifest.rs b/src/resource/manifest.rs index 8750f90..3e7421f 100644 --- a/src/resource/manifest.rs +++ b/src/resource/manifest.rs @@ -628,7 +628,7 @@ impl Manifest { fn add_custom_games(&mut self, config: &Config) { for custom_game in &config.custom_games { - if custom_game.ignore { + if custom_game.ignore || custom_game.name.trim().is_empty() { continue; } self.add_custom_game(custom_game.clone()); @@ -712,6 +712,11 @@ impl Manifest { let manifest = secondary.data.0; for (name, mut game) in manifest { + if name.trim().is_empty() { + log::debug!("ignoring secondary manifest game with blank name: '{name}'"); + continue; + } + game.normalize_relative_paths(); if let Some(standard) = self.0.get_mut(&name) {