-
Couldn't load subscription status.
- Fork 200
Description
Describe the issue
The _include parameters when retrieving XML data from Plex should be configurable. It would allow the user to save resources and speed up the response by only retrieving the XML tags/fields that they need.
Example hardcoded _include parameters for ~plexapi.video.Movie:
https://github.com/pkkid/python-plexapi/blob/163d94d2492e976841f4d7b011cbdef1d849e53e/plexapi/video.py#L289-L291
This is especially useful for the checkFiles=1 parameter since this causes the Plex server to hit the storage to check if a file exists (~plexapi.media.MediaPart.exists) and is accessible (~plexapi.media.MediaPart.accessible) which may timeout if cloud storage is being used for the Plex server.
Code snipppets
Example of an unnecessary "heavy" reload.
from plexapi.server import PlexServer
plex = PlexServer('http://localhost:32400', token='xxxxxxxxxxxxxxxxxxxx')
for movie in plex.library.section("Movies").all():
# This will trigger an automatic reload() of every movie with checkFiles=1
# even though the exists/accessible values are not needed
print(movie.subtitleStreams())Expected behavior
Example of a possible "lighter" reload.
from plexapi.server import PlexServer
plex = PlexServer('http://localhost:32400', token='xxxxxxxxxxxxxxxxxxxx')
for movie in plex.library.section("Movies").all():
# Manual reload() without checkFiles
movie.reload(checkFiles=False)
print(movie.subtitleStreams())Additional context
Some other XML includes that are available but not shown when viewing the XML through Plex.
includeFields=thumbBlurHashadds thethumbBlurHashfield to the XML (used by Plexamp)includeFields=artBlurHashadds theartBlurHashfield to the XML (used by Plexamp)
Reference: BlurHash.