Skip to content

Commit

Permalink
Incompatible with Immich v1.118
Browse files Browse the repository at this point in the history
Fixes #509
  • Loading branch information
simulot committed Oct 15, 2024
1 parent 7ee54ba commit 785f61a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions immich/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ func NewImmichClient(endPoint string, key string, options ...clientOption) (*Imm
func (ic *ImmichClient) PingServer(ctx context.Context) error {
r := PingResponse{}
b := bytes.NewBuffer(nil)
err := ic.newServerCall(ctx, EndPointPingServer).do(getRequest("/server-info/ping", setAcceptJSON()), responseCopy(b), responseJSON(&r))
err := ic.newServerCall(ctx, EndPointPingServer).do(getRequest("/server/ping", setAcceptJSON()), responseCopy(b), responseJSON(&r))
if err != nil {
return fmt.Errorf("unexpected response to the immich's ping API at this address: %s:\n%s", ic.endPoint+"/server-info/ping", b.String())
return fmt.Errorf("unexpected response to the immich's ping API at this address: %s:\n%s", ic.endPoint+"/server/ping", b.String())
}
if r.Res != "pong" {
return fmt.Errorf("incorrect ping response: %s", r.Res)
Expand Down Expand Up @@ -163,7 +163,7 @@ type ServerStatistics struct {
func (ic *ImmichClient) GetServerStatistics(ctx context.Context) (ServerStatistics, error) {
var s ServerStatistics

err := ic.newServerCall(ctx, EndPointGetServerStatistics).do(getRequest("/server-info/statistics", setAcceptJSON()), responseJSON(&s))
err := ic.newServerCall(ctx, EndPointGetServerStatistics).do(getRequest("/server/statistics", setAcceptJSON()), responseJSON(&s))
return s, err
}

Expand Down Expand Up @@ -204,7 +204,7 @@ var DefaultSupportedMedia = SupportedMedia{
func (ic *ImmichClient) GetSupportedMediaTypes(ctx context.Context) (SupportedMedia, error) {
var s map[string][]string

err := ic.newServerCall(ctx, EndPointGetSupportedMediaTypes).do(getRequest("/server-info/media-types", setAcceptJSON()), responseJSON(&s))
err := ic.newServerCall(ctx, EndPointGetSupportedMediaTypes).do(getRequest("/server/media-types", setAcceptJSON()), responseJSON(&s))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 785f61a

Please sign in to comment.