mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 14:03:42 +02:00
Do not try to fix non BoilR shortcut icons
This commit is contained in:
+22
-12
@@ -106,14 +106,22 @@ pub async fn download_images(settings: &Settings, userinfo_shortcuts: &Vec<Steam
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trait IsBoilRShortcut{
|
||||||
|
fn is_boilr_tag(&self) -> bool;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl IsBoilRShortcut for ShortcutOwned{
|
||||||
|
fn is_boilr_tag(&self) -> bool {
|
||||||
|
let boilr_tag = BOILR_TAG.to_string();
|
||||||
|
self.tags.contains(&boilr_tag) || self.dev_kit_game_id.starts_with(&boilr_tag)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fn remove_old_shortcuts(shortcut_info: &mut ShortcutInfo) {
|
fn remove_old_shortcuts(shortcut_info: &mut ShortcutInfo) {
|
||||||
let boilr_tag = BOILR_TAG.to_string();
|
|
||||||
shortcut_info
|
shortcut_info
|
||||||
.shortcuts
|
.shortcuts
|
||||||
.retain(|shortcut| !shortcut.tags.contains(&boilr_tag));
|
.retain(|shortcut| !shortcut.is_boilr_tag());
|
||||||
shortcut_info
|
|
||||||
.shortcuts
|
|
||||||
.retain(|shortcut| !shortcut.dev_kit_game_id.starts_with(&boilr_tag));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fix_shortcut_icons(
|
fn fix_shortcut_icons(
|
||||||
@@ -131,13 +139,15 @@ fn fix_shortcut_icons(
|
|||||||
};
|
};
|
||||||
|
|
||||||
for shortcut in shortcuts {
|
for shortcut in shortcuts {
|
||||||
let replace_icon = shortcut.icon.trim().eq("") || !Path::new(shortcut.icon.trim()).exists() || shortcut.icon.eq(&shortcut.exe);
|
if shortcut.is_boilr_tag(){
|
||||||
if replace_icon {
|
let replace_icon = shortcut.icon.trim().eq("") || !Path::new(shortcut.icon.trim()).exists() || shortcut.icon.eq(&shortcut.exe);
|
||||||
let app_id = steam_shortcuts_util::app_id_generator::calculate_app_id(
|
if replace_icon {
|
||||||
&shortcut.exe,
|
let app_id = steam_shortcuts_util::app_id_generator::calculate_app_id(
|
||||||
&shortcut.app_name,
|
&shortcut.exe,
|
||||||
);
|
&shortcut.app_name,
|
||||||
shortcut.icon = image_folder.join(image_type.file_name(app_id)).to_string_lossy().to_string();
|
);
|
||||||
|
shortcut.icon = image_folder.join(image_type.file_name(app_id)).to_string_lossy().to_string();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user