You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am looping through shows trying to get the paths.
plex_shows = [m for m in plex.library.section('TV Shows').all()]
plex_shows_by_path = {m.locations[0]: m for m in plex_shows}
It is extremely slow. It seems to be querying plex for each item in the location loop. Is there a faster way to do this? I would have thought the data would be pulled from the first line?
The location attribute is not available when querying Plex's /all endpoint using all() and will only return partial objects (you can check with show.isPartialObject() or show.isFullObject()). Objects are automatically reloaded (see reload()) for you when you access a missing attribute which requires querying Plex for the metadata of the individual show.
Activity
JonnyWong16 commentedon Jul 21, 2023
This is expected behaviour.
The
locationattribute is not available when querying Plex's/allendpoint usingall()and will only return partial objects (you can check withshow.isPartialObject()orshow.isFullObject()). Objects are automatically reloaded (seereload()) for you when you access a missing attribute which requires querying Plex for the metadata of the individual show.