#2082 You can now filter by metadata existence in the selector syntax

This commit is contained in:
Dion Moult
2022-04-27 22:19:31 +10:00
parent 11c3a6e547
commit 9ea6499b5a
3 changed files with 19 additions and 3 deletions
@@ -192,7 +192,9 @@ class Selector:
element_value = cls.get_element_value(element, key)
if element_value is None and value is not None:
continue
if not comparison or cls.filter_element(element, element_value, comparison, value):
if comparison and cls.filter_element(element, element_value, comparison, value):
results.append(element)
elif not comparison and element_value:
results.append(element)
return results