Skip to content

Commit

Permalink
fixup! feat: (wip) handle removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Anomalocaridid committed Oct 15, 2024
1 parent dc14be7 commit ed84068
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/apps/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,21 @@ impl MimeApps {
mime: &Mime,
handler: &DesktopHandler,
) -> bool {
self.removed_associations
.get(mime)
.map(|list| list.contains(handler))
.unwrap_or(false)
let wildcard = WildMatch::new(mime.as_ref());
mime_types()
.iter()
.filter(|mime| wildcard.matches(mime))
.map(|mime| {
self.removed_associations
.get(&Mime::from_str(mime).unwrap())
.map(|handlers| handlers.contains(handler))
.unwrap_or(false)
})
.any(|x| x)
// self.removed_associations
// .get(mime)
// .map(|list| list.contains(handler))
// .unwrap_or(false)
}

/// Select handler from given list, possibly using the selector
Expand Down

0 comments on commit ed84068

Please sign in to comment.