Skip to content

Make Plex XML "include" parameters configurable #603

@JonnyWong16

Description

@JonnyWong16

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=thumbBlurHash adds the thumbBlurHash field to the XML (used by Plexamp)
  • includeFields=artBlurHash adds the artBlurHash field to the XML (used by Plexamp)

Reference: BlurHash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions