|
|
@ -7,7 +7,6 @@ import (
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"github.com/hrfee/jfa-go/common"
|
|
|
|
|
|
|
|
"github.com/hrfee/jfa-go/mediabrowser"
|
|
|
|
"github.com/hrfee/jfa-go/mediabrowser"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
@ -60,7 +59,7 @@ func (app *appContext) TestJF(gc *gin.Context) {
|
|
|
|
if req.ServerType == "emby" {
|
|
|
|
if req.ServerType == "emby" {
|
|
|
|
serverType = mediabrowser.EmbyServer
|
|
|
|
serverType = mediabrowser.EmbyServer
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tempjf, _ := mediabrowser.NewServer(serverType, req.Server, "jfa-go-setup", app.version, "auth", "auth", common.NewTimeoutHandler("authJF", req.Server, true), 30)
|
|
|
|
tempjf, _ := mediabrowser.NewServer(serverType, req.Server, "jfa-go-setup", app.version, "auth", "auth", mediabrowser.NewNamedTimeoutHandler("authJF", req.Server, true), 30)
|
|
|
|
_, status, err := tempjf.Authenticate(req.Username, req.Password)
|
|
|
|
_, status, err := tempjf.Authenticate(req.Username, req.Password)
|
|
|
|
if !(status == 200 || status == 204) || err != nil {
|
|
|
|
if !(status == 200 || status == 204) || err != nil {
|
|
|
|
app.info.Printf("Auth failed with code %d (%s)", status, err)
|
|
|
|
app.info.Printf("Auth failed with code %d (%s)", status, err)
|
|
|
|