Uses config command name instead of os.Args

This commit is contained in:
kinduff 2021-03-17 15:16:41 +01:00
parent aebd0de203
commit d1f1fa2ef0

View File

@ -7,7 +7,6 @@ import (
"errors"
"fmt"
"net/http"
"os"
log "github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
@ -35,7 +34,7 @@ func NewClient(c *cli.Context) *Client {
func (c *Client) DoRequest(endpoint string, target interface{}) error {
apiVersion := "v3"
if len(os.Args) > 1 && os.Args[1] == "lidarr" {
if c.config.Command.Name == "lidarr" {
apiVersion = "v1"
}