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

LibrarySection.get() Returning the wrong series for titles with commas #1146

Open
CollinHeist opened this issue Apr 17, 2023 · 4 comments
Open

Comments

@CollinHeist
Copy link

Describe the Bug

When searching for a series within a Library, if the series name has a comma, then the plexapi.library.LibrarySection.get() method returns the incorrect series.

This has happened for multiple series:

  • Love, Victor returns a match for Ainsley's Food We Love
  • Sabrina, The Teenage Witch returns Chilling Adventures of Sabrina
  • Alex, Inc. returns Alex Rider

If the comma is removed from the string, the correct match is returned. My guess is that the comma is causing the URL encoding to perhaps split the search into multiple queries (or something else entirely).

Code Snippets

from plexapi.server import PlexServer

PLEX_URL = 'YOUR URL HERE'
PLEX_TOKEN = 'YOUR TOKEN HERE'
LIBRARY_NAME = 'LIBRARY NAME HERE'

server = PlexServer(PLEX_URL, PLEX_TOKEN)
library = server.library.section(LIBRARY_NAME)

# If Love, Victor and Ainsley's Food We Love are both present
print(library.get('Love, Victor').guids)
# Prints [<Guid:imdb://tt13428252>, <Guid:tmdb://112847>, <Guid:tvdb://387981>]
# which corresponds to the wrong show

print(library.get('Love Victor').guids)
# Prints [<Guid:imdb://tt10166602>, <Guid:tmdb://97186>, <Guid:tvdb://368188>]
# which is correct

Expected Behavior

I expect the API to return the correct show. In particular the show titles within Plex include the commas, so searching with a comma should not be an issue.

Additional Context

No response

Operating System and Version

Windows 10 22H2

Plex Media Server Version

1.31.3.6819

Python Version

3.10.11

PlexAPI Version

4.13.4

@JonnyWong16
Copy link
Collaborator

It seems to be a problem in Plex itself and not this Python library.

Go to the Advanced Filters in your library and try to do a filter for Title contains Love, Victor. Let me know if it works as expected. Also try Title is Love, Victor.

When I try it myself, Plex splits the filter into two filters Title contains Love and Title contains Victor.

@CollinHeist
Copy link
Author

Good catch - I see that as well. Perhaps this should be documented in the get method docs so that users can either manually remove the comma from their search or use the search method (and just filter the results manually)

@JonnyWong16
Copy link
Collaborator

No, this should be reported to Plex so they can fix it.

@CollinHeist
Copy link
Author

Posted on the forum here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants