Metadata agents for exported XBMC library

I managed to make this agent work for a movie section I have but I can't for the life of me make it work for series... Anyway, my main issue is that I'm still not sure of all the authorized/taken in account tags I can use.

I would very much like a list of all the tags you can use and have an effect to fill the data in a movie section.

What works for the Movies section:

Any text you want

Any text you want

YYYY

YYYY-MM-DD

Any text you want

Any text you want

Any text you want

Name Surname

Name Surname, Name Surname, Name Surname

Name Surname, Name Surname, Name Surname (for the writers)

Genre, Genre, Genre

Any MPAA rating

CountryName, CountryName, CountryName

Collections, Collections, Collections (for collections)

Repeated words after a comma meaning that you can add any number of those words with a comma as separation between them to have each word added to Plex.

Not working as far I can tell:

Number of Minutes

What's missing:

Sort Title (I tried , sorttitle> without success but I red it was not possible to add it?)

An explicit list of all the usable and working tags would be very nice as well as for the series.

Thanks

No one managed to get the series NFO working???

I managed to get the in the tvshow.nfo to change according to what is the nfo but everything else doesn't work so please someone give me a sample of an nfo for tvshows and episodes that works for a show that wouldn't look or any data on the web but find all in the nfo.

No one managed to get the series NFO working???

I managed to get the in the tvshow.nfo to change according to what is the nfo but everything else doesn't work so please someone give me a sample of an nfo for tvshows and episodes that works for a show that wouldn't look or any data on the web but find all in the nfo.

You can look at your Log Files. At the moment there is an unfixed Bug so it won't work for many people.

This Bug looks like:

2013-04-20 12:41:38,019 (19c0) :  INFO (logkit:16) - Update called for TV Show with id = 5672

2013-04-20 12:41:38,020 (19c0) :  CRITICAL (core:561) - Exception in the update function of agent named 'XBMC TV .nfo Importer', called with guid 'com.plexapp.agents.xbmcnfotv://74205?lang=xn' (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 971, in _update
    agent.update(obj, media, lang)
  File "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\XBMCnfoTV.bundle\Contents\Code\__init__.py", line 86, in update
    path1 = media.items[0].parts[0].file
  File "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py", line 110, in
    _getitem_           = lambda x, y: x.__getitem__(y),
IndexError: list index out of range

Yes I have the index out of range issue as well. No one was saying much of anything about the tv shows nfo not working so I assumed it was only me. But if no one got it working it is "reassuring" :) I would very much to have it working though as my non regular shows are quite numerous and being able to nfo them would be very nice.

Thank you for your answer.

Yes I have the index out of range issue as well. No one was saying much of anything about the tv shows nfo not working so I assumed it was only me. But if no one got it working it is "reassuring" :) I would very much to have it working though as my non regular shows are quite numerous and being able to nfo them would be very nice.

Thank you for your answer.

Maybe you could use this slighlty older version. it should work for you.

https://github.com/gboudreau/XBMC-TVShows-Metadata-Agent-for-Plex/tree/20ad6f7bd65ffcea677edf615cd8f5f92ec9a00d

BTW: Nice anime collection.  :)

Thanks!!!

I got some episodes infos working with this one:


    Night Time is the Right Time
    The best episode in the world
    2013-03-15

The and don't work though. But well... There are no filter on either in TV shows, neither on actors...

For the TVShow.nfo the file works with:

<?xml version="1.0" encoding="UTF-8" ?>

    SomeSeries
    2013-01-07 for "Originally Available"
    2013 for "Year"
    Plot Text here
    STUDIO name
    Rating

But , , and or collections are not working.

Hi,

these are the actually used Tags in the TVShow agent, others will be implemented if possible:














These are the possible metadata Types:

http://dev.plexapp.com/docs/agents/models.html

Well there is no medata for the actors of tv shows in the models or in the episodes (on the other hand the file doesn't show any actor for the movies either but we know this exist and actually has a filter while there is none for the series). There is a Episode.guest_stars though...

I tried to implement the Episode.writers and the Episode.directors but it didn't work as expected. In fact Plex was looping on the addition of the nfo medatada for some reasons.

				#director
				try: 
					directors = nfoXML.xpath('./director')
					episode.directors.clear()
					for directorXML in directors:
						ds = directorXML.text.split("/")
						if ds != "":
							for d in ds:
								episode.directors.add(d)
				except: pass
				#writers/credits
				try: 
					credits = nfoXML.xpath('./credits')
					episode.writers.clear()
					for creditXML in credits:
						writer = creditXML.text
						episode.writers.add(writer)
				except: pass

using the code from the XBMC nfo movie and replacing metadata by episode.

I suppose this has been tried already and I'm only trying to re-invent the wheel here...

Hello

It seems that the "Sorting Title" is not being scraped.

What do I have to do, that I get FSK ratings over PG-13 and so on.

Thanks in advanve

Hello
 
It seems that the "Sorting Title" is not being scraped.
 
What do I have to do, that I get FSK ratings over PG-13 and so on.
 
 
Thanks in advanve


In your mpaa tag write de/rating instead of the American rating. Eg. de/16

Where do I look for logs for XBMC agents?  Running Ubuntu 12.04, PMS 0.9.7.22.  Agents are:

XBMC-TVShows-Metadata-Agent-for-Plex-20ad6f7bd65ffcea677edf615cd8f5f92ec9a00d

and

XBMC-Movies-Metadata-Agent-for-Plex-master, latest from Github yesterday.

The agents are shown when Settings/Agents is selected.  Other agents can be selected together and then reordered by drag-and-drop, but if the xbmc agent is chosen only it shows in the list.  Scanning for TV shows went great for most series, local art, including banners and posters, was used, for all of the series, except one that had all hand-created .nfo files.  That show was an American show that I titled "Money Vacation".  After the 1st try I added 1234 to tvshow.nfo for that series, but the scan kept changing it to a Brit. series named "Vacation, Vacation, Vacation".  I only have 5 series in the test, so I kept deleting and starting over.  I would watch as it picked up the local title, then displayed the local poster.jpg, then late in the scan it retitled and used the description for V,V,V.   For some reason it does not impose its episode description.

One problem is that the agent keeps changing in the Settings/Agent location even though I keep changing it back.  When I create the library I only see Plex Scanner or somesuch in the pulldown.

Can I force it to always use local files created for xbmc?

Movies are picking up local art but not .nfos as far as I can tell.

The only logs I find with xbmc in the name  were created before I even installed the xbmc agents, so where do I look?

When creating the library section you leave the Plex Scanner as it is, but you have to change the agent to XBMC .nfo Importer or XBMC TV .nfo Importer!

If you didn't do this, the XBMC agent was not used to scan your media. If you have no XBMC .nfo Importer in the Agents field something went wrong with the installation of the agent. Please check that you put the extracted .bundle directories into the Plug-ins directory.

Please use the latest XBMC TV .nfo Importer. The index out of range error was fixed, so no need to use an older version. The fix was reverted for now. I'll have to check with Guillaume why this is. Discussion will be on github.

The agent log files will reside in Logs/PMS Plugin Logs/.

SlrG

Thank you Guillaume!

My previous post may have been a bit whiney.  Since then I have banged on the XBMC stuff for several hours.  Since I was doing several things wrong, I may have done some unnecessary things or even things that may be causing problems.  I still do not know why com.plexapp.agents.xbmc*logs were ceated before I even installed the plugins.

Now I have installed the latest versions of both xbmc plugins.  I have also created entries in "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Metadata Combination":

drwxr-xr-x 2 plex plex 4096 May  6 18:03 com.plexapp.agents.xbmcnfo
drwxr-xr-x 2 plex plex 4096 May  6 18:12 com.plexapp.agents.xbmcnfotv

and created "com.plexapp.agents.xbmcnfo/Movies.xml" and
"com.plexapp.agents.xbmcnfotv/TV Shows.xml"

Movies.xml:

<?xml version='1.0' encoding='utf8'?>

 
      com.plexapp.agents.localmedia
      com.plexapp.agents.xbmcnfo
 


TV Shows.xml:


   
        com.plexapp.agents.localmedia
        com.plexapp.agents.xbmcnfotv</agent
   


Restarted PMS.  Looked at Settings for Movies and TV Shows agents (how do I
attach or embed screenshots?) and Agents were defaulted to cine21 for Movies and Personal Media Shows for TV Shows.

I rm'ed my test libraries and re-added a test dir of tv-shows and a test dir of movies.  As I added them I selected the appropriate  xbmc agent for each type.  When I added the movies, Guillaume's XBMC agent loaded art, nfos and titles without a hitch, even though some of my movie titles are a bit quirky.  There are 12 movies.

When I added the tv shows, my titles were used for each series, even one that has hand-created .nfo files.  However, none of the art is picked up and none of the nfo show or episode description are picked up.

I have checked Logs/Plex Media Scanner.log and Logs/PMS\ Plugin\ Logs/*xbmcnfotv*.log  and the only com.plexapp.agents. calls are to xbmcnfotv, but I know the .nfo files are being opened long enough to get the series title.

Should I have something else in TV\ Shows.xml?

Progress!

I'm not Guillaume, but I think the problem is that you don't select the XBMC agent when creating the section. Step by step this would be clicking + to create a new section. Select the type of the section i.e. TV Shows. Select the directories you want to be scanned. Select "Show Advanced Options" (I have a german Frontend, so I don't know if this is the right translation). And then change the Agent field to use the XBMC TV .nfo Importer.

SlrG

I'm not Guillaume, but I think the problem is that you don't select the XBMC agent when creating the section. Step by step this would be clicking + to create a new section. Select the type of the section i.e. TV Shows. Select the directories you want to be scanned. Select "Show Advanced Options" (I have a german Frontend, so I don't know if this is the right translation). And then change the Agent field to use the XBMC TV .nfo Importer.

SlrG

That is exactly what I did, finally.  As I say above the xbmcnfotv.log and Plex Media Scanner.log files the only com.plexapp.agents.  calls are to xbmcnfotv.   The version I first downloaded was XBMC-TVShows-Metadata-Agent-for-Plex-20ad6f7bd65ffcea677edf615cd8f5f92ec9a00d, but I replaced it with the current one that has the index out of range error.  I will go back to it now that I have figured out where to select the scanner option.

Okay. :) Using the old version, it should work then. A refined fixed version will hopefully be online soon. At the time I was posting to use the newest version I did not know the fix was reverted for now to be replaced by a better version.

Edit: The better version of the fix is now online. Credits go to Guillaume. He found a really nice solution. :)

Tried the latest version.  It pulls the proper series name from the nfo, but does not get the fanart, the poster, nor does it instantiate the plot and other text fields, but it does create the thumbs for the episodes and creates an episode for each mp4 file with seriesxepisode or snnenn in the filename.  The log file shows that the Plot and other details are extracted from the nfo file. The behavior is no different from the several months old version.  I do not see any evidence in the logs that com.plexapp.agents.localmedia is being called, even though I have created the TV Shows.xml file in Metadata Combination.  Running the scan for Personal media pulls all the jpgs/tbns/pngs and puts them in the right place but does not even try to handle text.

Hmm..., the TV Shows.xml modification should not be needed anymore. For me the new version works without problems and without the mod.

Could you try to remove the mod and try again? Another thing you could try is to start over with a fresh plex installation and only adding the two .bundles for XBMC importer. Please stop plex before adding the .bundle and check the file ownership and permission of the .bundles and subdirs. If you copy in root shell they'll get root ownership. Restart plex afterwards.

If it still doesn't work, upload your logs somewhere and post a link please.

Yeah!  I went back to square 0. It took 4 hours and a purge of the install, but now it is mostly working.  Movies are still working completely but gave me a scare when the screen did not update after loading.  I had to go to the Libraries page and come back to the Movies library for the entries to show up.  poster.jpg as poster, fanart.jpg as background, and my plots, actors, etc..

TV shows now work almost completely.  They show my poster.jpg as the poster and my season0n.tbn for the appropriate season.  moviename-nxnn-fanart.jpg is not showing as a background.  Is it supposed to with tv shows.  My title's and my hand edited text is displayed on the episode pages.

For both Movies and TV Shows  some pages where I have clicked down to the episode or movie show a rectangle or two with the word Image in it.   What images might those be that are missing?   On some of those pages the stars are displayed or rating (G, R, NR) are shown.  The rectangles might be in the lower right corner or below something else in the upper right corner.

Yeah!

Just guessing here: Did you refresh your Browser Cache? Maybe old links are interfering with new content.

Where does the problem occur? In Plexweb or in a client?

For Movies the Fanart shows in the Background on my install.

For TV Shows it does not, but I guess it should, so there still might be is a problem lurking somewhere in the agent.

For TV Shows the file should not be named moviename...-fanart however but fanart.jpg or seasonx-fanart.jpg, shouldn't it?

Going down to episode level on the left side of the plot there will be the episode image (in most cases a screencap from the episode). That may be what is missing for you. For me it gets imported fine, if it has the same filename as the episode but the extension .jpg.

regards

SlrG