Download image names based on mime type (#124)

This commit is contained in:
Philip Kristoffersen
2022-05-14 08:05:51 +02:00
committed by GitHub
parent 9f59957edc
commit a5733cbebf
5 changed files with 94 additions and 36 deletions
+7 -4
View File
@@ -150,10 +150,13 @@ fn fix_shortcut_icons(
&shortcut.exe,
&shortcut.app_name,
);
shortcut.icon = image_folder
.join(image_type.file_name(app_id))
.to_string_lossy()
.to_string();
for ext in ["ico", "png", "jpg", "webp"] {
let path = image_folder.join(image_type.file_name(app_id, ext));
if path.exists() {
shortcut.icon = path.to_string_lossy().to_string();
break;
}
}
}
}
}