This commit is contained in:
Alin
2024-08-05 09:44:06 -06:00
parent 12bf18315d
commit a16a8a6757
3 changed files with 20 additions and 8 deletions
+14 -3
View File
@@ -71,7 +71,7 @@ class ReversePathsSearcher {
guard !skipReverse.contains(where: { itemName.pearFormat().contains($0) }),
isSupportedFileType(at: itemURL.path),
!isRelatedToInstalledApp(itemPath: itemPath, itemPathOG: itemURL),
!isRelatedToInstalledApp(itemURL: itemURL),
!isExcludedByConditions(itemPath: itemPath) else {
return
@@ -80,11 +80,22 @@ class ReversePathsSearcher {
collection.append(itemURL)
}
private func isRelatedToInstalledApp(itemPath: String, itemPathOG: URL) -> Bool {
private func isRelatedToInstalledApp(itemURL: URL) -> Bool {
let itemPath = itemURL.path.pearFormat()
for app in sortedApps {
if itemPath.contains(app.bundleIdentifier.pearFormat()) || itemPath.contains(app.appName.pearFormat()) || itemPathOG.containerNameByUUID().pearFormat().contains(app.bundleIdentifier.pearFormat()) {
if itemPath.contains(app.bundleIdentifier.pearFormat()) ||
itemPath.contains(app.appName.pearFormat()) {
return true
}
// Check if the path contains /Containers or /Group Containers
if itemURL.path.contains("/Containers/") {
let containerName = itemURL.containerNameByUUID().pearFormat()
if containerName.contains(app.bundleIdentifier.pearFormat()) {
return true
}
}
}
return false
}