Skip to content

Apply buildQueryKey across entire library for object data parity - #1596

Merged
JonnyWong16 merged 3 commits into
pushingkarmaorg:masterfrom
JonnyWong16:feature/buildQueryKey
Apr 6, 2026
Merged

Apply buildQueryKey across entire library for object data parity#1596
JonnyWong16 merged 3 commits into
pushingkarmaorg:masterfrom
JonnyWong16:feature/buildQueryKey

Conversation

@JonnyWong16

Copy link
Copy Markdown
Collaborator

Description

Apply the _buildQueryKey function from #1593 across the entire PlexAPI library to ensure data parity in all object responses.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the docstring for new or existing methods
  • I have added tests when applicable

CopilotAI review requested due to automatic review settings March 22, 2026 23:45

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands usage of the shared _buildQueryKey helper across PlexAPI object-fetching methods to consistently include includeGuids and other query params, improving response parity for partial/related object lookups.

Changes:

  • Replaced hand-built query strings (and some plain keys) with _buildQueryKey(...) across video/audio/photo/playlist/library/collection/mixins.
  • Updated PlexObject._buildQueryKey to correctly append parameters when the input key already contains an existing query string (?).
  • Standardized a few fetch patterns by building the key first, then calling fetchItem/fetchItems.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
plexapi/base.pyFixes _buildQueryKey to merge params with keys that already contain ?.
plexapi/library.pyApplies _buildQueryKey to hubs/onDeck/recentlyAdded/search/tag/filter fetches.
plexapi/video.pyApplies _buildQueryKey to onDeck and parent/grandparent fetches for show/season/episode relations.
plexapi/audio.pyApplies _buildQueryKey to nearest/allLeaves/parent relations and station fetches.
plexapi/photo.pyApplies _buildQueryKey to children/parent lookups for albums/photos/clips.
plexapi/playlist.pyApplies _buildQueryKey to playlist item retrieval endpoint.
plexapi/collection.pyApplies _buildQueryKey to collection children retrieval.
plexapi/mixins/objects.pyApplies _buildQueryKey to extras and related hubs mixins.
plexapi/media.pyApplies _buildQueryKey to media tag items() retrieval.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadplexapi/library.py
Comment threadplexapi/base.py

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadplexapi/library.py
Comment threadtests/test_fetch_items.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@JonnyWong16
JonnyWong16 merged commit 7d5ad3a into pushingkarmaorg:masterApr 6, 2026
5 checks passed
@JonnyWong16
JonnyWong16 deleted the feature/buildQueryKey branch April 7, 2026 01:41
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@JonnyWong16