From ed79119f3f3e4e4204d56ccc92ed649c72fa08c7 Mon Sep 17 00:00:00 2001 From: bel Date: Thu, 5 Jun 2025 19:20:49 -0600 Subject: [PATCH] shuff --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 8e961ca..d77b212 100644 --- a/main.go +++ b/main.go @@ -52,7 +52,7 @@ func NewJelly(ctx context.Context, u, p, apitoken, optAccessToken string) (Jelly } func (jelly Jelly) login(ctx context.Context, p string) (string, error) { - resp, err := jelly.post(ctx, "https://jellyfin.home.blapointe.com/Users/AuthenticateByName", map[string]string{ + resp, err := jelly.post(ctx, "/Users/AuthenticateByName", map[string]string{ "Username": jelly.u, "Pw": p, }, "Authorization", jelly._authHeader(jelly.apitoken)) @@ -67,7 +67,7 @@ func (jelly Jelly) login(ctx context.Context, p string) (string, error) { return AccessToken.AccessToken, err } -func (jelly Jelly) post(ctx context.Context, url string, body any, headers ...string) (*http.Response, error) { +func (jelly Jelly) post(ctx context.Context, path string, body any, headers ...string) (*http.Response, error) { t := http.Transport{ DisableKeepAlives: true, } @@ -77,7 +77,7 @@ func (jelly Jelly) post(ctx context.Context, url string, body any, headers ...st } b, _ := json.Marshal(body) - req, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(b)) + req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("https://jellyfin.home.blapointe.com%s", path), bytes.NewReader(b)) if err != nil { return nil, err }