diff --git a/plugins/host/subsonicapi.go b/plugins/host/subsonicapi.go index c0ba41853..d8fa900d3 100644 --- a/plugins/host/subsonicapi.go +++ b/plugins/host/subsonicapi.go @@ -14,5 +14,5 @@ type SubsonicAPIService interface { // The uri parameter should be the Subsonic API path without the server prefix, // e.g., "getAlbumList2?type=random&size=10". The response is returned as raw JSON. //nd:hostfunc - Call(ctx context.Context, uri string) (response []byte, err error) + Call(ctx context.Context, uri string) (responseJSON string, err error) } diff --git a/plugins/host/subsonicapi_gen.go b/plugins/host/subsonicapi_gen.go index c5bdf22a0..5b42d67d8 100644 --- a/plugins/host/subsonicapi_gen.go +++ b/plugins/host/subsonicapi_gen.go @@ -11,8 +11,8 @@ import ( // SubsonicAPICallResponse is the response type for SubsonicAPI.Call. type SubsonicAPICallResponse struct { - Response []byte `json:"response,omitempty"` - Error string `json:"error,omitempty"` + ResponseJSON string `json:"responseJSON,omitempty"` + Error string `json:"error,omitempty"` } // RegisterSubsonicAPIHostFunctions registers SubsonicAPI service host functions. @@ -34,14 +34,14 @@ func newSubsonicAPICallHostFunction(service SubsonicAPIService) extism.HostFunct } // Call the service method - response, err := service.Call(ctx, uri) + responsejson, err := service.Call(ctx, uri) if err != nil { subsonicapiWriteError(p, stack, err) return } // Write JSON response to plugin memory resp := SubsonicAPICallResponse{ - Response: response, + ResponseJSON: responsejson, } subsonicapiWriteResponse(p, stack, resp) },