Update search for New ZIM files, to search in descriptions as well

This commit is contained in:
Balazs Perlaki-Horvath 2024-08-02 23:49:06 +02:00 committed by Kelson
parent f2b137232c
commit 5dd7a08210

View File

@ -103,7 +103,12 @@ struct ZimFilesNew: View {
predicates.append(NSPredicate(format: "created > %@", aMonthAgo as CVarArg))
}
if !searchText.isEmpty {
predicates.append(NSPredicate(format: "name CONTAINS[cd] %@", searchText))
predicates.append(
NSCompoundPredicate(orPredicateWithSubpredicates: [
NSPredicate(format: "name CONTAINS[cd] %@", searchText),
NSPredicate(format: "fileDescription CONTAINS[cd] %@", searchText)
])
)
}
return NSCompoundPredicate(andPredicateWithSubpredicates: predicates)
}