mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(filters): regex match release support list (#265)
This commit is contained in:
parent
8b1174c65f
commit
9d52d42440
2 changed files with 15 additions and 5 deletions
|
@ -319,13 +319,21 @@ func (f Filter) checkSizeFilter(r *Release, minSize string, maxSize string) bool
|
|||
return true
|
||||
}
|
||||
|
||||
func matchRegex(tag string, filter string) bool {
|
||||
re, err := regexp.Compile(`(?i)(?:` + filter + `)`)
|
||||
if err != nil {
|
||||
return false
|
||||
func matchRegex(tag string, filterList string) bool {
|
||||
filters := strings.Split(filterList, ",")
|
||||
|
||||
for _, filter := range filters {
|
||||
re, err := regexp.Compile(`(?i)(?:` + filter + `)`)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
match := re.MatchString(tag)
|
||||
if match {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return re.MatchString(tag)
|
||||
return false
|
||||
}
|
||||
|
||||
// checkFilterIntStrings "1,2,3-20"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue