mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Do not try to fix non BoilR shortcut icons
This commit is contained in:
@@ -106,14 +106,22 @@ pub async fn download_images(settings: &Settings, userinfo_shortcuts: &Vec<Steam
|
||||
}
|
||||
}
|
||||
|
||||
fn remove_old_shortcuts(shortcut_info: &mut ShortcutInfo) {
|
||||
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) {
|
||||
shortcut_info
|
||||
.shortcuts
|
||||
.retain(|shortcut| !shortcut.tags.contains(&boilr_tag));
|
||||
shortcut_info
|
||||
.shortcuts
|
||||
.retain(|shortcut| !shortcut.dev_kit_game_id.starts_with(&boilr_tag));
|
||||
.retain(|shortcut| !shortcut.is_boilr_tag());
|
||||
}
|
||||
|
||||
fn fix_shortcut_icons(
|
||||
@@ -131,6 +139,7 @@ fn fix_shortcut_icons(
|
||||
};
|
||||
|
||||
for shortcut in shortcuts {
|
||||
if shortcut.is_boilr_tag(){
|
||||
let replace_icon = shortcut.icon.trim().eq("") || !Path::new(shortcut.icon.trim()).exists() || shortcut.icon.eq(&shortcut.exe);
|
||||
if replace_icon {
|
||||
let app_id = steam_shortcuts_util::app_id_generator::calculate_app_id(
|
||||
@@ -141,6 +150,7 @@ fn fix_shortcut_icons(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn write_shortcut_collections<S: AsRef<str>>(
|
||||
steam_id: S,
|
||||
|
||||
Reference in New Issue
Block a user