Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Issue in Server.getLibrarySections() method #1

Open
hunsbct opened this issue Jan 14, 2018 · 4 comments
Open

Issue in Server.getLibrarySections() method #1

hunsbct opened this issue Jan 14, 2018 · 4 comments

Comments

@hunsbct
Copy link

hunsbct commented Jan 14, 2018

I am using this API to build a front-end app to access my Plex media as a programming exercise. I have no issues logging in and collecting the list of servers, but when I select a server to list its libraries, it gets a null response. Here is what I know:

  • In GetLibrarySections(), MediaContainer m comes up null
  • When the new MediaContainer object is instantiated with the Load() method, var m in Load() comes up null.
  • Following the definitions down, public T Execute(RestRequest request, RestClient client) where T : new() returns null because Response.data is null. However, Response.content has a JSON object with valid data.

I am still not great with some of the techniques used here so if you have any suggestions please let me know.

@ammmze
Copy link
Owner

ammmze commented Jan 16, 2018

Hmm...yea...so forgot everything in this project. I haven't really done any C# since this project 5 years ago (which I ultimately abandoned). I primarily use Java and JavaScript/Node. I was going to use this to build an extension for Windows Media Center, but I had run into some road blocks and couldn't find time to work on it. So I don't really remember anything in here, but looking through some of the commit comments it looks like at the time the plex api responded with XML rather than JSON. So perhaps there is needs to be something changed to deserialize JSON.

@hunsbct
Copy link
Author

hunsbct commented Jan 16, 2018

I was already thinking I'd need some JSON parsing, so I've been tinkering with that Newtonsoft JSON package. Thanks!

@Brhsoftco
Copy link

I am using this API to build a front-end app to access my Plex media as a programming exercise. I have no issues logging in and collecting the list of servers, but when I select a server to list its libraries, it gets a null response. Here is what I know:

* In GetLibrarySections(), MediaContainer m comes up null

* When the new MediaContainer object is instantiated with the Load() method, var m in Load() comes up null.

* Following the definitions down, public T Execute(RestRequest request, RestClient client) where T : new() returns null because Response.data is null. However, Response.content has a JSON object with valid data.

I am still not great with some of the techniques used here so if you have any suggestions please let me know.

Old thread, I know. I basically demanded that RestSharp use XML instead of JSON, since Plex's API uses XML. There's a method for it if you update the RestSharp NuGet package for this library. https://github.com/brh-media/plexdl is my application.

@hunsbct
Copy link
Author

hunsbct commented Nov 6, 2020

Interesting, thanks!

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

No branches or pull requests

3 participants