Skip to content

Commit

Permalink
Fix shortcuts by using acutal shortcut app_id (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipK authored Oct 6, 2022
1 parent 81e2110 commit 10093bf
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/sync/synchronization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down

0 comments on commit 10093bf

Please sign in to comment.