Skip to content

Commit

Permalink
Incompatible with Immich v1.118 (#510)
Browse files Browse the repository at this point in the history
Fixes #509
  • Loading branch information
simulot committed Oct 27, 2024
1 parent 14b5ba4 commit cbae2fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ Global Flags:
## Release 0.23.0-alpha1 🏗️ Work in progress 🏗️


## Release 0.22.1

### Fixes:
- [#509](https://github.com/simulot/immich-go/issues/509)


## Release 0.22.0
Many thanks to @maybeanerd for their meticulous proofreading of the documentation files.

Expand Down
8 changes: 4 additions & 4 deletions immich/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,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 @@ -169,7 +169,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 All @@ -191,7 +191,7 @@ func (ic *ImmichClient) GetAssetStatistics(ctx context.Context) (UserStatistics,
func (ic *ImmichClient) GetSupportedMediaTypes(ctx context.Context) (metadata.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 cbae2fd

Please sign in to comment.