mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Sort out duplicates heroic games (#68)
This commit is contained in:
@@ -58,11 +58,15 @@ impl Platform<HeroicGame, Box<dyn Error>> for HeroicPlatform {
|
|||||||
}
|
}
|
||||||
fn get_shortcuts(&self) -> Result<Vec<HeroicGame>, Box<dyn Error>> {
|
fn get_shortcuts(&self) -> Result<Vec<HeroicGame>, Box<dyn Error>> {
|
||||||
let install_modes = vec![InstallationMode::FlatPak, InstallationMode::UserBin];
|
let install_modes = vec![InstallationMode::FlatPak, InstallationMode::UserBin];
|
||||||
let shortcuts = install_modes
|
let mut shortcuts :Vec<HeroicGame> = install_modes
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|install_mode| get_shortcuts_from_install_mode(install_mode).ok())
|
.filter_map(|install_mode| get_shortcuts_from_install_mode(install_mode).ok())
|
||||||
.flatten()
|
.flatten()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
shortcuts.sort_by_key(|m| format!("{}-{}-{}",m.launch_parameters,m.executable,&m.app_name));
|
||||||
|
shortcuts.dedup_by_key(|m| format!("{}-{}-{}",m.launch_parameters,m.executable,&m.app_name));
|
||||||
|
|
||||||
Ok(shortcuts)
|
Ok(shortcuts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user