mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(filters): except categories (#510)
fix(filters): except categories check
This commit is contained in:
parent
2cc08bed71
commit
532df38cd4
2 changed files with 55 additions and 3 deletions
|
@ -341,7 +341,7 @@ func (f Filter) CheckFilter(r *Release) ([]string, bool) {
|
|||
if r.Category != "" {
|
||||
categories = append(categories, r.Category)
|
||||
}
|
||||
if !contains(r.Category, f.MatchCategories) && !containsAny(r.Categories, f.MatchCategories) {
|
||||
if !contains(r.Category, f.MatchCategories) && !containsAny(categories, f.MatchCategories) {
|
||||
r.addRejectionF("category not matching. got: %v want: %v", strings.Join(categories, ","), f.MatchCategories)
|
||||
}
|
||||
}
|
||||
|
@ -352,8 +352,8 @@ func (f Filter) CheckFilter(r *Release) ([]string, bool) {
|
|||
if r.Category != "" {
|
||||
categories = append(categories, r.Category)
|
||||
}
|
||||
if !contains(r.Category, f.ExceptCategories) && !containsAny(r.Categories, f.ExceptCategories) {
|
||||
r.addRejectionF("category unwanted. got: %v want: %v", strings.Join(categories, ","), f.ExceptCategories)
|
||||
if contains(r.Category, f.ExceptCategories) && containsAny(categories, f.ExceptCategories) {
|
||||
r.addRejectionF("category unwanted. got: %v unwanted: %v", strings.Join(categories, ","), f.ExceptCategories)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue