fix(filters): check match other and except other (#433)

fix(filters): check other and excpet other
This commit is contained in:
ze0s 2022-08-27 14:54:41 +02:00 committed by GitHub
parent 48d6468503
commit 9813f5718d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 74 deletions

View file

@ -286,6 +286,16 @@ func (f Filter) CheckFilter(r *Release) ([]string, bool) {
r.addRejectionF("hdr unwanted. got: %v want: %v", r.HDR, f.ExceptHDR)
}
// Other is parsed into the Other slice from rls
if len(f.MatchOther) > 0 && !sliceContainsSlice(r.Other, f.MatchOther) {
r.addRejectionF("match other not matching. got: %v want: %v", r.Other, f.MatchOther)
}
// Other is parsed into the Other slice from rls
if len(f.ExceptOther) > 0 && sliceContainsSlice(r.Other, f.ExceptOther) {
r.addRejectionF("except other unwanted. got: %v unwanted: %v", r.Other, f.ExceptOther)
}
if f.Years != "" && !containsIntStrings(r.Year, f.Years) {
r.addRejectionF("year not matching. got: %d want: %v", r.Year, f.Years)
}