From 10093bf3eb83c43482de7abfe460e1172516db5d Mon Sep 17 00:00:00 2001 From: Philip Kristoffersen Date: Thu, 6 Oct 2022 21:44:27 +0200 Subject: [PATCH] Fix shortcuts by using acutal shortcut app_id (#245) --- src/sync/synchronization.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/sync/synchronization.rs b/src/sync/synchronization.rs index ae62f88..52c05b6 100644 --- a/src/sync/synchronization.rs +++ b/src/sync/synchronization.rs @@ -178,17 +178,13 @@ fn fix_shortcut_icons( }; for shortcut in shortcuts { - if shortcut.is_boilr_shortcut() { - let app_id = steam_shortcuts_util::app_id_generator::calculate_app_id( - &shortcut.exe, - &shortcut.app_name, - ); - for ext in ["ico", "png", "jpg", "webp"] { - let path = image_folder.join(image_type.file_name(app_id, ext)); - if path.exists() { - shortcut.icon = format!("\"{}\"", path.to_string_lossy().to_string()); - break; - } + let app_id = shortcut.app_id; + let icon_exsists = Path::new(&shortcut.icon).exists() && !shortcut.icon.is_empty(); + for ext in ["ico", "png", "jpg", "webp"] { + let path = image_folder.join(image_type.file_name(app_id, ext)); + if !icon_exsists && path.exists() { + shortcut.icon = format!("\"{}\"", path.to_string_lossy().to_string()); + break; } } }