fix(rss): improve dispatching of tmdb items to appropriate pvr's (#33)

This commit is contained in:
l3uddz
2021-11-21 13:24:13 +00:00
committed by GitHub
parent 685a9a075d
commit a4d8a0e4cc
5 changed files with 80 additions and 33 deletions

33
util/newznab.go Normal file
View File

@@ -0,0 +1,33 @@
package util
import "strconv"
func ContainsTvCategory(cats []string) bool {
for _, cat := range cats {
cn, err := strconv.Atoi(cat)
if err != nil {
continue
}
if cn >= 5000 && cn <= 5999 {
return true
}
}
return false
}
func ContainsMovieCategory(cats []string) bool {
for _, cat := range cats {
cn, err := strconv.Atoi(cat)
if err != nil {
continue
}
if cn >= 2000 && cn <= 2999 {
return true
}
}
return false
}