gboudreau/XBMCnfoTVImporter.bundle

Please add support for TheMovieDB and TheTVDB

Opened this issue · 18 comments

Please add support for those two so that we can use NFO files if available and fall back to the other agents.

        accepts_from   = ['com.plexapp.agents.localmedia','com.plexapp.agents.opensubtitles','com.plexapp.agents.podnapisi','com.plexapp.agents.plexthememusic','com.plexapp.agents.subzero','com.plexapp.agents.thetvdb','com.plexapp.agents.themoviedb']
        contributes_to = ['com.plexapp.agents.thetvdb','com.plexapp.agents.themoviedb']
SlrG commented

Can you please elaborate a little bit more? When I add those lines, the additional agents appear under tvshow settings. I can drag them around, but when I enable them, the setting doesn't stick. As soon as I change the tab, the alternate agent gets disabled again. How do you make use of the additional agents when local NFOs are missing?

For me, the checkmarks stick. Plex tries from top to bottom, so XBMCnfo* has to be on top. If this doesn't find a NFO file, Plex will try the next agent from the list.

SlrG commented

Okay. :) Thank you for your explanation. I'll try to find out, what fails on my system.

SlrG commented

It was my addblocker which was at fault. Settings do stick now. But no matter how I drag the agents order I don't get the effect you describe. No fallback to online agent when XBMCnfo agent fails due to missing nfo files. Can you provide me some screenshots or a video how you do it and how and when it is working?

I'm not sure whether I had to "Fix incorrect match" to have it match. You're right, looking at the code, it tries various shady things to match the folder against some data instead of just giving up if there's no NFO file. That should be fixed, then.

SlrG commented

Hmm... If I remember correctly rematching single items was always possible to use. Even when not adding something to contributes_to and accepts_from. What code do you look at? Is this something for the plex devs to fix? I would really like to incorporate such automatic fallback mechanisms but I have no idea how to do it at the moment.

In the init.py … it's trying really hard to get any match and falls back to just generating something based on the filenames. I guess if it wouldn't do that, the next agent should take over.

SlrG commented

Hmm... I think I understand what you refer to. But if you look at the Movies agent, it quits immediately when no nfo file is found. But even then, there is no automatic fallback to MovieDB or freebase for me, even if I added and enabled them. I removed all metadata from a movie in my testing library, made sure it is available on Freebase and MovieDB. I enabled freebase and put it after the XBMCnfoMoviesImporter in settings. Scanning leaves me with a movie without any info. The same happens when I select MovieDB. So I somehow doubt removing those things you mention from the tvshows agents will have a different outcome. I'll try it when I have the time. I would be glad however, if you could try yourself too and provide me with a working pull request.

After finding some official documentation, I now think the correct way would be to set fallback_agent instead of the other two. I'll try this in the next few days and report back.

SlrG commented

Any news on this? I can't get it to work even using fallback_agent. Did you have more knowledge or luck? :)

I've been taking a look at this and done some testing and it looks like fallback_agent only works if the search method doesn't return a MetadataSearchResult for the item being resolved. Because currently it always appends a result (guessing the show name from the filename if there is no tvshow.nfo file) it will never fail to find a result and the fallback agent is never used.
By changing the method to not return a result if there is no tvshow.nfo file I was able to successfully get this to work (at least when manually matching using Match or Fix Incorrect Match).

Maybe there could be an additional preference (such as "guess show name from filename if tvshow.nfo not found") which would allow this default behaviour to be changed. By doing this (and also setting the fallback_agent to com.plexapp.agents.thetvdb) we would be able to use TheTVDB as a fallback.

SlrG commented

Cool. Thank you very much for this information! I'll give it a try.

SlrG commented

@gadgetchnnel:
Can you show me the lines of code you changed, to make this work? That would be cool. I tried a lot of things and was not able to get it to work. :( Armchair developer only. :)

@gadgetchnnel Yes, please share the code! I need a TVDB fallback to incorporate this plug-in into my Plex workflow (which I really want to do) 😄

M0UL commented

any update on this?

SlrG commented

The newest versions have a contributes_to tag. If this is enough to suit your needs, I don't know.

M0UL commented

this does not seems to work. the agents now shows on the list of agents of thetvdb agent. not the other way around. and adding XBMCnfoTVImporter on the top of the tvdb agent . then it wont import anything.

what try to do is use the XBMCnfoTVImporter agent to import the show info. the use the tvdb date to get everything else.

SlrG commented

In the forum thread a user mentioned a xml nfo importer agent. It seems to do what you want. Maybe you want to give it try.