0.2.72 - Magic button, Next up fixes

This commit is contained in:
ponzischeme89
2026-08-17 11:41:36 +12:00
parent 36cb1324fd
commit 12b27c77c3
2655 changed files with 5435 additions and 254 deletions
+18 -4
View File
@@ -720,14 +720,28 @@ func (c *Client) SubtitleURL(cred Credentials, itemID, mediaSourceID string, ind
return c.DeliveryURL(cred, path)
}
// Ping checks that Emby is reachable, for readiness probes.
func (c *Client) Ping(ctx context.Context) error {
// Ping checks that Emby is reachable, for readiness probes, and reports the version it
// answered with.
//
// The version is read off the reply the probe was already making rather than through a
// call of its own: `/System/Info/Public` carries it, this runs on a timer against a server
// whose version changes a few times a year, and a second request per probe to learn a
// string that rarely moves would be the wrong trade. An Emby that answers without one
// returns an empty version and no error — reachability is what this is for, and refusing a
// probe over a missing field would report a working server as down.
func (c *Client) Ping(ctx context.Context) (string, error) {
req, err := c.newRequest(ctx, http.MethodGet, "/System/Info/Public", nil,
Credentials{Gateway: true}, nil)
if err != nil {
return err
return "", err
}
return c.do(req, nil)
var info struct {
Version string `json:"Version"`
}
if err := c.do(req, &info); err != nil {
return "", err
}
return info.Version, nil
}
func (c *Client) items(ctx context.Context, cred Credentials, path string, params url.Values) (*ItemsResult, error) {