mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Only add installed heroic games
This commit is contained in:
@@ -13,6 +13,12 @@ pub struct HeroicGame {
|
|||||||
pub launch_parameters: String,
|
pub launch_parameters: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl HeroicGame{
|
||||||
|
fn is_installed(&self) -> bool{
|
||||||
|
Path::new(&self.install_path).join(&self.executable).exists()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<HeroicGame> for ShortcutOwned {
|
impl From<HeroicGame> for ShortcutOwned {
|
||||||
fn from(game: HeroicGame) -> Self {
|
fn from(game: HeroicGame) -> Self {
|
||||||
let target_path = Path::new(&game.install_path).join(game.executable);
|
let target_path = Path::new(&game.install_path).join(game.executable);
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ impl Platform<HeroicGame, Box<dyn Error>> for HeroicPlatform {
|
|||||||
.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()
|
||||||
|
.filter(|s| s.is_installed())
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
shortcuts.sort_by_key(|m| format!("{}-{}-{}",m.launch_parameters,m.executable,&m.app_name));
|
shortcuts.sort_by_key(|m| format!("{}-{}-{}",m.launch_parameters,m.executable,&m.app_name));
|
||||||
|
|||||||
Reference in New Issue
Block a user