fix: flatpaks with multiple entries only show one

This commit is contained in:
Michael Aaron Murphy 2025-10-01 00:18:53 +02:00 committed by Michael Murphy
parent 092d78f7ca
commit 904b690c27
3 changed files with 25 additions and 6 deletions

View file

@ -9,7 +9,7 @@ publish = false
[dependencies]
async-pidfd = "0.1.5"
fork = "0.2.0"
freedesktop-desktop-entry = "0.7.17"
freedesktop-desktop-entry = "0.7.19"
human_format = "1.1.0"
human-sort = "0.2.2"
new_mime_guess = "4.0.4"

View file

@ -72,9 +72,16 @@ impl<W: AsyncWrite + Unpin> App<W> {
let desktop_entries = paths
.flat_map(|path| DesktopEntry::from_path(path, Some(&locales)))
.filter_map(|de| {
// Treat Flatpak and system apps differently in the cache so they don't
// override each other
let appid = de.flatpak().unwrap_or_else(|| de.appid.as_ref());
// Cache flatpak apps separately from non-flatpak apps.
let _flatpak_appid;
let appid = match de.flatpak() {
Some(base_id) => {
_flatpak_appid = [base_id, ".", de.appid.as_str()].concat();
_flatpak_appid.as_str()
}
None => de.appid.as_str(),
};
if deduplicator.contains(appid) {
return None;
}