From 8a5541ece4db66e40cfa539fc24469bc187de552 Mon Sep 17 00:00:00 2001 From: Arnas Udovic Date: Fri, 9 Aug 2024 12:43:20 +0300 Subject: [PATCH] support exclude filter #3 (category) --- tree.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tree.go b/tree.go index d5e244d..45e329f 100644 --- a/tree.go +++ b/tree.go @@ -104,6 +104,14 @@ func (t Tree) Filter(filter map[string][]string) (Tree, bool) { } continue } + if negative && option == "category" { + for _, category := range f.Category { + if category == value { + exclude = true + } + } + continue + } if !negative && strings.Contains(f.Meta[option], value) { addFile = true continue