use app identifier instead of ctx

changing this because ctx is commonly used with the context package.
This commit is contained in:
Harvey Tindall
2020-08-16 13:36:54 +01:00
parent fffb3471d6
commit fd766e7b1a
9 changed files with 452 additions and 445 deletions
+3 -3
View File
@@ -10,14 +10,14 @@ type testReq struct {
Password string `json:"jfPassword"`
}
func (ctx *appContext) TestJF(gc *gin.Context) {
func (app *appContext) TestJF(gc *gin.Context) {
var req testReq
gc.BindJSON(&req)
tempjf := Jellyfin{}
tempjf.init(req.Host, "jfa-go-setup", ctx.version, "auth", "auth")
tempjf.init(req.Host, "jfa-go-setup", app.version, "auth", "auth")
_, status, err := tempjf.authenticate(req.Username, req.Password)
if !(status == 200 || status == 204) || err != nil {
ctx.info.Printf("Auth failed with code %d (%s)", status, err)
app.info.Printf("Auth failed with code %d (%s)", status, err)
gc.JSON(401, map[string]bool{"success": false})
return
}