Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve getGuid method #862

Merged
merged 2 commits into from
Jan 24, 2022
Merged

Conversation

JonnyWong16
Copy link
Collaborator

Description

Improve the LibrarySection.getGuid() method so it doesn't need to iterate through the entire library to find a specific external guid.

This change "exploits" the "Fix Match" function in Plex which allows searching by external guids. We fetch a dummy object (the first media object in the library) and call the match function using the external guid. Then a library search is performed by using the Plex guid (plex://) from the match. Searching for a Plex guid is much faster since it is offloaded to the Plex server which supports filtering by the main guid.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

@JonnyWong16 JonnyWong16 merged commit d2c849f into pkkid:master Jan 24, 2022
@JonnyWong16 JonnyWong16 deleted the bugfix/getGuid branch January 24, 2022 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant