-
Notifications
You must be signed in to change notification settings - Fork 9
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
Allow interaction with providers #13
Comments
Fantastic observation! |
The various SDKs should be regenerated shortly, please let me know if things work as you would expect. |
I would note that documenting the provider API is also something I would like to do, so if we want to create a list of the valid provider server endpoints, and what methods exactly the support that would be a great thing to include. |
Circling back around here, this change will have to wait for a feature to be implemented in the SDK package, I'm reverting this change for now. |
No problem I'll keep an eye on this issue to see. Thank you! |
This is tentatively resolved in the newest release. Can you pull it down and validate it? |
So I noticed I had some user error in my original example
I updated my example to It appears that this error is about the type of
|
Can you confirm you updated the package? The newest NPM release should fix the type issue |
Yes, I can confirm I updated the package. The type issue before was the As I mentioned in my previous comment the issue now is the response shape, not the input validation. https://github.com/LukeHagar/plexjs/blob/main/src/models/getlibraryitemsop.ts#L207 |
Understood, I just updated the value to a type array |
I noticed version 18 was published today. I can confirm everything works! I tested using the following in Deno and I get the expected response back. Thank you! import { PlexAPI } from "npm:@lukehagar/[email protected]";
let watch = new PlexAPI({ accessToken: "TOKEN", serverURL: "https://discover.provider.plex.tv" })
let watchlist = await watch.library.getLibraryItems("watchlist", "all")
console.log(watchlist.object.mediaContainer.metadata.length) |
Providers from Plex (Tidal Music Integration, Watchlist) expose an almost identical API as Plex Servers.
However restrictions in the schema prevent these sdks from using a provider as an input.
For example one can set up an instance like so:
However trying to interact with the
watchlist
library section ID ends up with an errorLooking the schema, the input is restricted to a number. Taking a peek at the code relaxing this to be a number or string should allow reading these provider libraries, which otherwise return the same API shape
Would it be possible to update the schema to allow for this possibility?
The text was updated successfully, but these errors were encountered: