mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
feat(filters): add except origins (#396)
* feat(filters): add except origins * feat(filters): add user origin
This commit is contained in:
parent
bd8db18a0e
commit
5d80e48b54
8 changed files with 49 additions and 5 deletions
|
@ -67,6 +67,7 @@ type Filter struct {
|
|||
ExceptReleaseGroups string `json:"except_release_groups,omitempty"`
|
||||
Scene bool `json:"scene,omitempty"`
|
||||
Origins []string `json:"origins,omitempty"`
|
||||
ExceptOrigins []string `json:"except_origins,omitempty"`
|
||||
Bonus []string `json:"bonus,omitempty"`
|
||||
Freeleech bool `json:"freeleech,omitempty"`
|
||||
FreeleechPercent string `json:"freeleech_percent,omitempty"`
|
||||
|
@ -140,6 +141,9 @@ func (f Filter) CheckFilter(r *Release) ([]string, bool) {
|
|||
if len(f.Origins) > 0 && !containsSlice(r.Origin, f.Origins) {
|
||||
r.addRejectionF("origin not matching. got: %v want: %v", r.Origin, f.Origins)
|
||||
}
|
||||
if len(f.ExceptOrigins) > 0 && containsSlice(r.Origin, f.ExceptOrigins) {
|
||||
r.addRejectionF("except origin not matching. got: %v unwanted: %v", r.Origin, f.ExceptOrigins)
|
||||
}
|
||||
|
||||
// title is the parsed title
|
||||
if f.Shows != "" && !contains(r.Title, f.Shows) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue