Skip to content

c.Status.ListSessions(ctx) returns json parsing error? #7

@clambin

Description

@clambin

Hey,

I recently found your plex client and was looking to use it instead of my own client. Looks good, but for some reason I'm getting json parsing errors in some area. This one I'm looking at right now:

sessions, err := c.Status.ListSessions(ctx)

this gives me back the following json error: error unmarshaling json response body: json: cannot unmarshal string into Go struct field ListSessionsMediaContainer.MediaContainer.Metadata.id of type int64.

I couldn't find an id in Metadata (weird), but did find a discrepancy in Metadata.Media (which is a []components.Media), where Id is defined as an *int64. However, looking at the raw http response, I see:

{
  "MediaContainer" : {
    "size" : 1,
    "Metadata" : [ {
      "Media" : [ {
        "id" : "6230",
        "Part" : [ {
          "id" : "6230",
          "Stream" : [ {
            "id" : "27330",
          }, {
            "id" : "27331",
          } ]
        } ]
      } ],
    } ]
  }
}

(response truncated for brevity). Notice that all id's are strings, whereas plexgo defined them as *int64.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions