Skip to content

Commit

Permalink
Fix bug where epic games would doulbe
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipK committed Mar 21, 2022
1 parent b4dbcdd commit 52791fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
8 changes: 6 additions & 2 deletions src/egs/get_manifests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ pub(crate) fn get_egs_manifests(
.filter_map(|dir| dir.ok())
.filter_map(get_manifest_item)
.filter(is_game_installed)
.filter(is_game_launchable);
Ok(manifests.collect())
.filter(is_game_launchable);
let mut manifests : Vec<ManifestItem> = manifests.collect();
manifests.sort_by_key(|m| format!("{}-{}-{}",m.install_location,m.launch_executable,m.is_managed));
manifests.dedup_by_key(|m| format!("{}-{}-{}",m.install_location,m.launch_executable,m.is_managed));
Ok(manifests)
}
Err(err) => Err(ReadDirError {
error: err,
Expand All @@ -50,6 +53,7 @@ pub(crate) fn get_egs_manifests(
}
}


fn get_manifest_dir_path(
settings: &EpicGamesLauncherSettings,
) -> Result<String, EpicGamesManifestsError> {
Expand Down
11 changes: 5 additions & 6 deletions src/egs/manifest_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ pub(crate) struct ManifestItem {

fn exe_shortcut(manifest: ManifestItem) -> ShortcutOwned {
let exe = manifest.exe();
let mut start_dir = manifest.install_location.clone();
if !manifest.install_location.starts_with('"') {
start_dir = format!("\"{}\"", manifest.install_location);
}
let start_dir = manifest.install_location.clone();
let exe = exe.trim_matches('\"');
let start_dir = start_dir.trim_matches('\"');
Shortcut::new(
0,
manifest.display_name.as_str(),
exe.as_str(),
start_dir.as_str(),
exe,
start_dir,
"",
"",
"",
Expand Down

0 comments on commit 52791fb

Please sign in to comment.