mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
feat(filter): add rejection on invalid size set (#991)
* feat(filter): add rejection on invalid size set * return false
This commit is contained in:
parent
c587c07b36
commit
1fbf3c828e
1 changed files with 4 additions and 2 deletions
|
@ -551,7 +551,8 @@ func (f Filter) checkSizeFilter(r *Release, minSize string, maxSize string) bool
|
|||
// string to bytes
|
||||
minSizeBytes, err := humanize.ParseBytes(minSize)
|
||||
if err != nil {
|
||||
// log could not parse into bytes
|
||||
r.addRejectionF("size: invalid minSize set: %s err: %q", minSize, err)
|
||||
return false
|
||||
}
|
||||
|
||||
if r.Size <= minSizeBytes {
|
||||
|
@ -565,7 +566,8 @@ func (f Filter) checkSizeFilter(r *Release, minSize string, maxSize string) bool
|
|||
// string to bytes
|
||||
maxSizeBytes, err := humanize.ParseBytes(maxSize)
|
||||
if err != nil {
|
||||
// log could not parse into bytes
|
||||
r.addRejectionF("size: invalid maxSize set: %s err: %q", maxSize, err)
|
||||
return false
|
||||
}
|
||||
|
||||
if r.Size >= maxSizeBytes {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue