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

Adding IMDb/TMDb search filter for the new plex movie agent #557

Closed
Mnk3y opened this issue Aug 21, 2020 · 10 comments · Fixed by #831
Closed

Adding IMDb/TMDb search filter for the new plex movie agent #557

Mnk3y opened this issue Aug 21, 2020 · 10 comments · Fixed by #831

Comments

@Mnk3y
Copy link

Mnk3y commented Aug 21, 2020

Since the last update of the new agent there is no IMDb/TMDb id in the guid attribute of the video element anymore. Instead, 2 new entries have been added to the XML.

For example <Guid id="imdb://tt0054215"/> and <Guid id="tmdb://539"/>.

The guid attribute looks like this now guid="plex://movie/5d7768264de0ee001fcc87e0".
With the old agent it looked like this guid="com.plexapp.agents.imdb://tt0054215".

So now you can no longer search for the IMDb id like this search(guid='imdb://tt0054215').

@blacktwin
Copy link
Collaborator

We should at least wait until this release is out of beta.

@PearsonFlyer
Copy link

Just a note that this is no longer in beta. Thank you for all you do!

@blacktwin
Copy link
Collaborator

search(guid='12345') only worked because guid was hardcoded into the ALLOWED_FILTERS for the different library types. The search would pull the entire library and search for the guid instead of using Plex to apply it's filtering. ALLOWED_FILTERS has been removed in favor of using the libraries known filters. Because searching via guid is not supported in the webUI it is now, not supported in this project. That is IMO the scope of this project. Obviously, that can be changed with an approved PR.

Check out this comment in the above mentioned thread for good overview for what can happen next.

@josh-gaby
Copy link

@blacktwin searching by guid may not be supported in the webUI but you can still filter by it when access the plex URLs directly, does this mean that it will still work since it's a valid filter or have I got the wrong idea about what a filter is?

i.e.
PLEX_URL/library/all?guid=plex://movie/5d9f3dc2ca3253001ef32b76&X-Plex-Token=XXXX returns the Police Academy movie
and
PLEX_URL/library/all?guid=thetvdb://71663&X-Plex-Token=XXXX returns The Simpsons TV series

@blacktwin
Copy link
Collaborator

blacktwin commented Oct 13, 2020

@josh-gaby Searching by guid still works. But it looks like it's dependent on which search you're using.

plex.library.search(guid='com.plexapp.agents.imdb://tt8695030')                    # works
plex.library.section('Movies').search(guid='com.plexapp.agents.imdb://tt8695030')  # does not work
plex.search(guid='com.plexapp.agents.imdb://tt8695030')                           # does not work

Back the issue, you cannot search for imdb://tt8695030 like in the above example if that library is using the new Plex Movie Agent and that item has been updated.

@josh-gaby
Copy link

@blacktwin so with this change will the plex.library.search(guid='com.plexapp.agents.imdb://tt8695030') guid search still work or will all of the guid searching be removed so that all search endpoints behave consistently?

@blacktwin
Copy link
Collaborator

guid search as seen above works because that search uses the url structure you laid out PLEX_URL/library/all?guid=.... Thats not changing. Only the primary guid can be searched like that.

From the initial issue:

So now you can no longer search for the IMDb id like this search(guid='imdb://tt0054215').

If the library uses the new Plex Movie Agent and the item in question has been updated and it's guid now starts with plex://movie/... and searching via guid with anything other than plex://movie/... will result in nothing.

The issue is that when the new Plex Movie Agent is used, it's guid (plex://movie/... ) is now the primary guid. The third party guids (tvdb, tmdb, imdb, etc.) are available in an items XML but there is no way to search for it if it is not the primary guid.

Here is an example of how you could search for imdb://tt8695030 when every item in your Movies library has been updated to use the New Plex Movie Agent and PR #562 merged:

for item in plex.library.section('Movies').all():
   for guid in item.guids:
        if guid.id == `imdb://tt8695030`:
            print('Found tt8695030 as {}. Plex Movie Agent GUID: {}'.format(item.title, item.guid))

Check out this comment in the above mentioned thread for good overview for what can happen next.

The comment mentions creating a reverse dictionary lookup once then referencing that instead of running through the entire library each time. So those are our options, run through the entire library each run or the user/operation/third party app would create a reserve dictionary lookup once and reference that. Either way I don't think that this issue will be resolve within the project.

@adrianherr
Copy link

Hi. Is there a way to get a list of all the movies and their IMDB number?

@pfgp
Copy link

pfgp commented Nov 27, 2023

Hi. Is there a way to get a list of all the movies and their IMDB number?

@adrianherr were you able to figure it out? I'm trying to do the same thing.

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

Successfully merging a pull request may close this issue.

7 participants