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

Broken with recent Plex version #86

Open
daguej opened this issue Mar 9, 2017 · 8 comments
Open

Broken with recent Plex version #86

daguej opened this issue Mar 9, 2017 · 8 comments

Comments

@daguej
Copy link

daguej commented Mar 9, 2017

Running against PMS 1.4.1.3362, immediately after instantiating a new PlexControl:

TypeError: Cannot read property 'filter' of undefined
    at filterChildrenByCriterias (my-project/node_modules/plex-api/lib/api.js:261:20)
    at my-project/node_modules/plex-api/lib/api.js:130:16
    at _fulfilled (my-project/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (my-project/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (my-project/node_modules/q/q.js:796:13)
    at my-project/node_modules/q/q.js:604:44
    at runSingle (my-project/node_modules/q/q.js:137:13)
    at flush (my-project/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Was working prior to upgrading Plex.

@phillipj
Copy link
Owner

phillipj commented Mar 9, 2017

I'm guessing it is related to the new format introduced in Plex v1.3: #75

@Tommatheussen
Copy link

Tommatheussen commented Apr 13, 2017

I've got the same, running Version 1.5.4.3596.
Any progress on this? :)

EDIT: Noticed it only happened when using client.find("/") for me, using query works fine.

@thomasvnl
Copy link

thomasvnl commented May 18, 2017

Having the same issue. Always results in the same error whatever I try to do with plex-control. I am using Plex 1.6.1.3722

@Eisbaeeer
Copy link

Hi
think the api doesn´t work, because nobody close this issue?
Using plex-media-server 1.9.3.4290

@phillipj
Copy link
Owner

phillipj commented Oct 2, 2017

@Eisbaeeer I'd assume you're correct. Mostly because of me that obviously doesn't find the time to prioritise working on it.

That said, anyone who's willing to contribute are more than welcome.

@boostup
Copy link

boostup commented Dec 9, 2017

use client.query directly

const movieSectionURL = "/library/sections/1/all" ;

client.query(movieSectionURL).then(function (result) {
    //console.log( result.MediaContainer );
    const {
        Metadata
    } = result.MediaContainer;

    // Metadata.map(item => {
    //     console.log(item)
    //     console.log('---------------------------------')
    // });

    console.log(Metadata[0].Media[0])

}, function (err) {
    console.error("Could not connect to server", err);
});

prints:

{ videoResolution: '1080',
  id: 3494,
  duration: 6722027,
  bitrate: 2256,
  width: 1920,
  height: 800,
  aspectRatio: 2.35,
  audioChannels: 2,
  audioCodec: 'aac',
  videoCodec: 'h264',
  container: 'mp4',
  videoFrameRate: '24p',
  optimizedForStreaming: 1,
  audioProfile: 'lc',
  has64bitOffsets: false,
  videoProfile: 'high',
  Part:
   [ { id: 7832,
       key: '/library/parts/7832/1463945897/file.mp4',
       duration: 6722027,
       file: '/Volumes/starck/movies/Thor 2 (2013)The Dark World.mp4',
       size: 1895918175,
       audioProfile: 'lc',
       container: 'mp4',
       has64bitOffsets: false,
       hasChapterTextStream: true,
       optimizedForStreaming: true,
       videoProfile: 'high' } ] }

@xochilpili
Copy link

xochilpili commented Jan 4, 2019

return filterChildrenByCriterias(result._children, criterias);

Change to this :

result._children = result._children || result.MediaContainer.Directory; 
return filterChildrenByCriterias(result._children, criterias);

PS.- Will only work for all those keys in Directory...

@phillipj
Copy link
Owner

With #92 merged, this should be improved quite a lot.

Don't hesitate reporting more still-failing queries, if you've got the response from the Plex Media Server as well, that would be extremely helpful.

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

No branches or pull requests

7 participants