mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(indexers): mam parse vip as freeleech (#407)
This commit is contained in:
parent
7deac6a781
commit
9c036033e9
2 changed files with 32 additions and 2 deletions
|
@ -384,7 +384,7 @@ func (r *Release) MapVars(def *IndexerDefinition, varMap map[string]string) erro
|
|||
}
|
||||
|
||||
if freeleech, err := getStringMapValue(varMap, "freeleech"); err == nil {
|
||||
fl := strings.EqualFold(freeleech, "freeleech") || strings.EqualFold(freeleech, "yes") || strings.EqualFold(freeleech, "1")
|
||||
fl := StringEqualFoldMulti(freeleech, "freeleech", "yes", "1", "VIP")
|
||||
if fl {
|
||||
r.Freeleech = true
|
||||
r.Bonus = append(r.Bonus, "Freeleech")
|
||||
|
@ -441,7 +441,7 @@ func (r *Release) MapVars(def *IndexerDefinition, varMap map[string]string) erro
|
|||
}
|
||||
|
||||
if scene, err := getStringMapValue(varMap, "scene"); err == nil {
|
||||
r.IsScene = strings.EqualFold(scene, "true") || strings.EqualFold(scene, "yes")
|
||||
r.IsScene = StringEqualFoldMulti(scene, "true", "yes")
|
||||
}
|
||||
|
||||
// set origin. P2P, SCENE, O-SCENE and Internal
|
||||
|
@ -505,3 +505,12 @@ func SplitAny(s string, seps string) []string {
|
|||
}
|
||||
return strings.FieldsFunc(s, splitter)
|
||||
}
|
||||
|
||||
func StringEqualFoldMulti(s string, values ...string) bool {
|
||||
for _, value := range values {
|
||||
if strings.EqualFold(s, value) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue