LukeHagar / plexjs

A Typescript SDK for interacting with Plex Media Server
MIT License
21 stars 0 forks source link

[CRITICAL BUG] Mangled typing breaks numerous functions #23

Open Funtime60 opened 3 weeks ago

Funtime60 commented 3 weeks ago

At some point between the models in the src and those used by the NPM version, a number of types are being broken. I have noticed errors with the /library/onDeck endpoint yesterday and assumed it was my outdated plex server. My server returned integer strings instead of integers. Today I found it complaining that object.MediaContainer.Metadata[0].Media[0].Part[1].Stream[0].frameRate was NOT an integer. This prompted me to check the specs and find that the schema does NOT specify an integer.

upon examining the files provided by NPM for version 0.23.5 I found this file: node_modules/@lukehagar/plexjs/sdk/models/operations/getmetadatabyratingkey.js At line 70: frameRate: z.number().int().optional(), Clearly it's implying that the number is an int despite the the original schema. I'm not familiar enough with the workflow here to suggest a fix so for now I'm just going to manually patch this for my project.

LukeHagar commented 3 weeks ago

Hey @Funtime60!

Thank you for reporting this issue. I've forwarded it to the owners of the language generation and will let you know when I hear back.