mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(releases): releasetags freeleech parsing (#306)
* refactor(releases): remove err from constructor * fix(releases): freeleech parsing and filtering * chore: remove unused releaseinfo package
This commit is contained in:
parent
fd3f10f95a
commit
6675a1df3e
10 changed files with 79 additions and 618 deletions
|
@ -67,6 +67,7 @@ type Filter struct {
|
|||
ExceptReleaseGroups string `json:"except_release_groups"`
|
||||
Scene bool `json:"scene"`
|
||||
Origins []string `json:"origins"`
|
||||
Bonus []string `json:"bonus"`
|
||||
Freeleech bool `json:"freeleech"`
|
||||
FreeleechPercent string `json:"freeleech_percent"`
|
||||
Shows string `json:"shows"`
|
||||
|
@ -115,6 +116,10 @@ func (f Filter) CheckFilter(r *Release) ([]string, bool) {
|
|||
return r.Rejections, false
|
||||
}
|
||||
|
||||
if len(f.Bonus) > 0 && !sliceContainsSlice(r.Bonus, f.Bonus) {
|
||||
r.addRejectionF("bonus not matching. got: %v want: %v", r.Bonus, f.Bonus)
|
||||
}
|
||||
|
||||
if f.Freeleech && r.Freeleech != f.Freeleech {
|
||||
r.addRejection("wanted: freeleech")
|
||||
}
|
||||
|
@ -575,15 +580,6 @@ func containsAnySlice(tags []string, filters []string) bool {
|
|||
func checkFreeleechPercent(announcePercent int, filterPercent string) bool {
|
||||
filters := strings.Split(filterPercent, ",")
|
||||
|
||||
// remove % and trim spaces
|
||||
//announcePercent = strings.Replace(announcePercent, "%", "", -1)
|
||||
//announcePercent = strings.Trim(announcePercent, " ")
|
||||
|
||||
//announcePercentInt, err := strconv.ParseInt(announcePercent, 10, 32)
|
||||
//if err != nil {
|
||||
// return false
|
||||
//}
|
||||
|
||||
for _, s := range filters {
|
||||
s = strings.Replace(s, "%", "", -1)
|
||||
s = strings.Trim(s, " ")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue