Closed imranoftherings closed 2 years ago
This is intentional.
Lots of methods in PlexAPI return a PlexPartialObject
. This is done to ensure the API calls remain speedy and attributes are only loaded when needed. Accessing a missing attribute should automatically reload the object with all attributes. Or you can explicitly call the reload()
method yourself.
>> episodes = library.section(plex_tv_lib).get(show.title).episodes()
>> episodes[0].isPartialObject()
True
>> episodes[0].guids # This should automatically reload the object when accessing a missing attribute
>> episodes[0].isPartialObject()
False
>> episodes[1].isPartialObject()
True
>> episodes[1].reload() # Explicitly reload the object yourself
>> episodes[1].isPartialObject()
False
Thank you, appreciate the response. This is perfect.
Describe the Bug
It seems that if you fetch episodes as part of a show or season, the Episode objects don't have all the relevant information (for e.g. Guids). When I debugged this issue, I found this issue is because of the XML returned by the Plex Media Server.
It boils down to the API call
/library/metadata/<show or season ratingkey>/allLeaves
. This API call returns partial Episode details and hence the object itself doesn't have many key relevant information missingCode Snippets
Expected Behavior
Expect to see all of the Episode attributes returned
Additional Context
I modified the episodes method of Show and Season object to the following, to individually query metdata of each episode and copy it over. This obviously is quite expensive depending on the total number of episodes returned by the original query, but I am not familiar enough with the plex rest api to know whether there is an allLeaves alternate which will return well hydrated Episode information
Episode XML as part of the allLeaves query
Episode XML as a direct Episode metdata query
Operating System and Version
Windows 10
Plex Media Server Version
1.51.1.3185-700af1eb
Python Version
3.10
PlexAPI Version
4.12.1