mirror of
https://github.com/gabehf/sonarr-anime-importer.git
synced 2026-03-20 20:26:24 -07:00
feat: Anilist support
This commit is contained in:
parent
ec6c1cc0e0
commit
cdd7b67003
8 changed files with 541 additions and 143 deletions
30
helpers.go
Normal file
30
helpers.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// parses the boolean param "name" from url.Values "values"
|
||||
func parseBoolParam(values url.Values, name string) bool {
|
||||
param := values.Get(name)
|
||||
|
||||
if param != "" {
|
||||
val, err := strconv.ParseBool(param)
|
||||
if err == nil {
|
||||
return val
|
||||
}
|
||||
} else if _, exists := values[name]; exists {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// just the title, or "title a.k.a. english title" if both exist
|
||||
func FullAnimeTitle(title, engtitle string) string {
|
||||
if engtitle != "" {
|
||||
return title + " a.k.a. " + engtitle
|
||||
} else {
|
||||
return title
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue