Skip to content

Commit

Permalink
Ignore games with blank title
Browse files Browse the repository at this point in the history
  • Loading branch information
mtkennerly committed Nov 20, 2024
1 parent 96ba96b commit ef59e92
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion src/resource/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 6 additions & 1 deletion src/resource/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit ef59e92

Please sign in to comment.