Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed the types for metadata json responses #35

Merged
merged 9 commits into from
Apr 28, 2022
Merged

fixed the types for metadata json responses #35

merged 9 commits into from
Apr 28, 2022

Conversation

jrudio
Copy link
Owner

@jrudio jrudio commented Nov 6, 2021

With PMS 1.24.4.5081, the types that were changed should work for fetching sessions.

This will close #32

@danopia
Copy link

danopia commented Nov 21, 2021

Hi, I had the type issue with GetSessions() as well, and switching to this branch with go get github.com/jrudio/go-plex-client@dfd65db5fe92762d7f1b922b4c230fb6dd63fd5e fixed my issue. LGTM

@jrudio
Copy link
Owner Author

jrudio commented Nov 22, 2021

@danopia thanks for confirming these changes for GetSessions(). It seems these changes break GetPlaylist() (see #41) and possibly others.

@danopia
Copy link

danopia commented Nov 23, 2021

I actually observed an additional break on GetSessions() when running the above githash:

json: cannot unmarshal string into Go struct field Media.MediaContainer.Metadata.Media.aspectRatio of type float32

I don't have a capture of the JSON yet, so I'll be watching for it, seems to be related to a smarttv

@danopia
Copy link

danopia commented Nov 27, 2021

I grabbed a snapshot of a payload that mistypes aspectRatio, here's a copy with all IDs replaced: https://gist.github.com/danopia/40582119a310f4291fa001397179142c

On first glance it seems to be the only field that doesn't line up with the structs.

Would it be at all practical to allow decoding strings into number fields and vice-versa? It seems nothing prevents Plex from making another "small" change like this in the future :(

@jrudio
Copy link
Owner Author

jrudio commented Jan 6, 2022

Latest push handles the bool or int found in the optimizedForStreaming field in the response JSON from PMS

Will wait a bit to merge

@raine
Copy link

raine commented Apr 24, 2022

Could this be merged?

query = http://raspi:32400/library/sections/7/all
panic: json: cannot unmarshal number into Go struct field Media.MediaContainer.Metadata.Media.optimizedForStreaming of type bool

Thank you :)

raine added a commit to raine/go-plex-client that referenced this pull request Apr 24, 2022
fixed the types for metadata json responses
@jrudio jrudio merged commit e5b4386 into master Apr 28, 2022
@jrudio
Copy link
Owner Author

jrudio commented Apr 28, 2022

Sorry I think at the time I was waiting on a PR from one of the commenters on one of the issues on this repo because their fork looked good.

I merged it but there is improvements to be made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetSessions() - Fix metadata types
3 participants