diff --git a/check/checkrr.go b/check/checkrr.go index e7b1bfd..6a1ca60 100644 --- a/check/checkrr.go +++ b/check/checkrr.go @@ -97,7 +97,7 @@ func (c *Checkrr) Run() { ext := filepath.Ext(path) for _, v := range c.ignoreExts { - if v == ext { + if strings.EqualFold(v, ext) { ignore = true } } diff --git a/connections/lidarr.go b/connections/lidarr.go index e10d88d..c842695 100644 --- a/connections/lidarr.go +++ b/connections/lidarr.go @@ -2,7 +2,6 @@ package connections import ( "fmt" - "net" "strings" log "github.com/sirupsen/logrus" @@ -16,7 +15,7 @@ type Lidarr struct { server *lidarr.Lidarr Process bool ApiKey string - Address net.IPAddr + Address string Port int BaseURL string pathMaps map[string]string @@ -24,7 +23,7 @@ type Lidarr struct { func (l *Lidarr) FromConfig(conf *viper.Viper) { if conf != nil { - l.Address = net.IPAddr{IP: net.ParseIP(conf.GetString("address"))} + l.Address = conf.GetString("address") l.Process = conf.GetBool("process") l.ApiKey = conf.GetString("apikey") l.Port = conf.GetInt("port") @@ -88,7 +87,7 @@ func (l *Lidarr) RemoveFile(path string) bool { func (l *Lidarr) Connect() (bool, string) { if l.Process { if l.ApiKey != "" { - l.config = starr.New(l.ApiKey, fmt.Sprintf("http://%s:%v%v", l.Address.IP.String(), l.Port, l.BaseURL), 0) + l.config = starr.New(l.ApiKey, fmt.Sprintf("http://%s:%v%v", l.Address, l.Port, l.BaseURL), 0) l.server = lidarr.New(l.config) status, err := l.server.GetSystemStatus() if err != nil { diff --git a/connections/radarr.go b/connections/radarr.go index 7721d3c..31970bf 100644 --- a/connections/radarr.go +++ b/connections/radarr.go @@ -2,7 +2,6 @@ package connections import ( "fmt" - "net" "strings" log "github.com/sirupsen/logrus" @@ -16,7 +15,7 @@ type Radarr struct { server *radarr.Radarr Process bool ApiKey string - Address net.IPAddr + Address string Port int BaseURL string pathMaps map[string]string @@ -24,7 +23,7 @@ type Radarr struct { func (r *Radarr) FromConfig(conf *viper.Viper) { if conf != nil { - r.Address = net.IPAddr{IP: net.ParseIP(conf.GetString("address"))} + r.Address = conf.GetString("address") r.Process = conf.GetBool("process") r.ApiKey = conf.GetString("apikey") r.Port = conf.GetInt("port") @@ -67,7 +66,7 @@ func (r *Radarr) RemoveFile(path string) bool { func (r *Radarr) Connect() (bool, string) { if r.Process { if r.ApiKey != "" { - r.config = starr.New(r.ApiKey, fmt.Sprintf("http://%s:%v%v", r.Address.IP.String(), r.Port, r.BaseURL), 0) + r.config = starr.New(r.ApiKey, fmt.Sprintf("http://%s:%v%v", r.Address, r.Port, r.BaseURL), 0) r.server = radarr.New(r.config) status, err := r.server.GetSystemStatus() if err != nil { diff --git a/connections/sonarr.go b/connections/sonarr.go index e8dbbba..fd4d0c8 100644 --- a/connections/sonarr.go +++ b/connections/sonarr.go @@ -2,7 +2,6 @@ package connections import ( "fmt" - "net" "strings" log "github.com/sirupsen/logrus" @@ -16,7 +15,7 @@ type Sonarr struct { server *sonarr.Sonarr Process bool ApiKey string - Address net.IPAddr + Address string Port int BaseURL string pathMaps map[string]string @@ -24,7 +23,7 @@ type Sonarr struct { func (s *Sonarr) FromConfig(conf *viper.Viper) { if conf != nil { - s.Address = net.IPAddr{IP: net.ParseIP(conf.GetString("address"))} + s.Address = conf.GetString("address") s.Process = conf.GetBool("process") s.ApiKey = conf.GetString("apikey") s.Port = conf.GetInt("port") @@ -70,7 +69,7 @@ func (s *Sonarr) RemoveFile(path string) bool { func (s *Sonarr) Connect() (bool, string) { if s.Process { if s.ApiKey != "" { - s.config = starr.New(s.ApiKey, fmt.Sprintf("http://%s:%v%v", s.Address.IP.String(), s.Port, s.BaseURL), 0) + s.config = starr.New(s.ApiKey, fmt.Sprintf("http://%s:%v%v", s.Address, s.Port, s.BaseURL), 0) s.server = sonarr.New(s.config) status, err := s.server.GetSystemStatus() if err != nil { diff --git a/go.sum b/go.sum index 311306b..7a68cf3 100644 --- a/go.sum +++ b/go.sum @@ -363,6 +363,7 @@ github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzG github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/sasha-s/go-csync v0.0.0-20210812194225-61421b77c44b h1:qYTY2tN72LhgDj2rtWG+LI6TXFl2ygFQQ4YezfVaGQE= github.com/sasha-s/go-csync v0.0.0-20210812194225-61421b77c44b/go.mod h1:/pA7k3zsXKdjjAiUhB5CjuKib9KJGCaLvZwtxGC8U0s=