Metadata agents for exported XBMC library

And I don't want to ignore your suggestion, but I need to understand fully what has changed that the ability to use the local media scraper was lost. Do you have an old version of the agent that still supports this? If so, I could have a look at what was changed or removed and maybe readd it. How do you configure the local media agent to be used beforehand? And what good does it, do? How do you know it is used?

Is it really just adding the show.jpg and art.jpg files? If so, adding the lines you mentioned will be a possible solution.

Sorry but I don’t have the former agents
 I do keep all the version of PMS and PHT I downloaded, but not each of the agents or scanners :(


All I can say is that Plex may have changed some things making the XMBCnfo agent more restrictive (aka, only using the files you specified in the code).

I'll add your changes and submit them to Guillaume. I can't promise he'll pull them, however. He'll propably ask the same questions as I did. :)

My changes were just an example on how I fixed the issue. For a real support of Plex more stuff should be added. (backdrop.jpg, background.jpg and such). Once again, I'm not saying it should be done but just providing with a solution for those who ask.

Ah. I see. The source is available on Guillaumes github page. Feel free to modify it and send him a pull request. I'm rather busy at the moment, so I won't do it myself. Sorry. :(

Like Ismelda I too would like support for Plex file naming conventions like art.jpg or show.jpg. I am not coming from XBMC either but I have my personal collection of home movies as well as sports (soccer games and football games) set up as TV series on plex. It would be great to use these seemingly awesome bundles to help organize and maintain these types of media which obviously can’t be found in online metadata sites. I look forward to installing these tomorrow and I really want to thank the developers for creating and maintaining these!!!

Ah. I see. The source is available on Guillaumes github page. Feel free to modify it and send him a pull request. I'm rather busy at the moment, so I won't do it myself. Sorry. :(


I am new to all of this, I will send the pull request to Guillaumes if someone can tell me what that is and how to do it

You have to setup a free account on Github and fork Guillaumes repository. You then clone the fork to your local disc and do the changes you want. You then push the changes to your fork and then from your Github account send a pull request to Guillaume. He will look at your changes and decide if he want's to include them.

If he should decide to not include them, your work is not for naught. Just post a link to your repository here for others (who need the functionality you implemented) to download your modified agents from your repo.

Here a link to a the Github HOWTO on forking:

https://help.github.com/articles/fork-a-repo

What I don't understand however: If you use the Plex naming sheme to name all your media. Wouldn't the Plex supplied agents work fine in recognizing it? Or do you have handmade nfo files you want to support, too? Isn't it better to use the xbmc agents as a base to create new agents that do what you want, than modify the xbmc agent to do things, it was never meant to be?

Or if Plex doesn't recognize your media, isn't it easier to just rename your files in a way the xbmc agent expects them, than hack the agent to support a different way? With a lot of nice free renaming tools out there, this is just a matter of minutes.

You have to setup a free account on Github and fork Guillaumes repository. You then clone the fork to your local disc and do the changes you want. You then push the changes to your fork and then from your Github account send a pull request to Guillaume. He will look at your changes and decide if he want's to include them.

If he should decide to not include them, your work is not for naught. Just post a link to your repository here for others (who need the functionality you implemented) to download your modified agents from your repo.

Here a link to a the Github HOWTO on forking:

https://help.github.com/articles/fork-a-repo

What I don't understand however: If you use the Plex naming sheme to name all your media. Wouldn't the Plex supplied agents work fine in recognizing it? Or do you have handmade nfo files you want to support, too? Isn't it better to use the xbmc agents as a base to create new agents that do what you want, than modify the xbmc agent to do things, it was never meant to be?

Or if Plex doesn't recognize your media, isn't it easier to just rename your files in a way the xbmc agent expects them, than hack the agent to support a different way? With a lot of nice free renaming tools out there, this is just a matter of minutes.

thanks I will look into the github & forking bits!

Correct I want to have nfo files so the metadata is stored on my Drobo with the media file. One reason would be for any time in the future if I ever have to start Plex server over from scratch... this way I would not lose metadata I have written in PMS.  It will be particularly useful for my soccer collection as I do a mini write-up and pull in info from UEFA or FIFA sites.  Also when I upload those Croatia games it would be nice to keep the metadata  and poster/artwork together so other Hrvati (Croatians) will have everything nicely arranged as well

One example is as I am playing around with Plex I originally had my soccer library set up as a Movies section, then I switched to TV Series to have drill up/down based on tournament (Euro 1996, World Cup 1998, etc) and I had to re-copy & paste all of the metadata from the games in the 'Movies' type to the games in the 'TV Series' type.  Had I used nfo files the metadata would stay with the games and automatically imbedded when loaded to Plex.  Granted this won't help me again in this same way as I won't be switching back to a Movies type section for this content, but only to show that saving metadata in a file with the media itself can be useful, allows for backing up, sharing/uploading metadata to others, etc

Hi,

I would like to recommend two changes. But I am no programmer, and so I don't know how GitHub works, and I'm not really planning on finding it out :)

In the file __init__.py I would like to add "accepts_from ..." By adding this, you can select "Local Media Assets (Movies)" in the Agent Options page. Which in turn then finds .srt subtitle files next to the movie and adds them to Plex

class xbmcnfo(Agent.Movies):
	name = 'XBMC .nfo Importer'
	primary_provider = True
	languages = [Locale.Language.NoLanguage]
	accepts_from = ['com.plexapp.agents.localmedia']

Another change I would like to suggest is adding "backdrop.jpg" to the fanart. I get these files with "meta".

		fanartNames.append (self.getRelatedFile(path1, '-fanart.jpg'))
		fanartNames.append (self.getRelatedFile(path1, 'backdrop.jpg'))

Regards,

Stijn

I'm on vacation for two weeks. When I return I'll have a look at adding the "accepts from" changes. Maybe this is something the TVShow agent could use, too.

I did the proposed changes and sent a pull request to Guillaume. If he pulls them, the changes will be available at his github repo.

edit: the changes are merged and available

How could I merge the "Skip Trailers" functionality (skip files or folders with trailer or trailers in the name) in this post with this NFO scanner?

Otherwise, I get another "movie" for each trailer file :(

@AgileHumor

I don't have this problem. My trailers are named "movie name whatever-trailer.avi" (flv,mpg,mov, ...) and reside in the same directory as the movie itself. If you have another structure, that might explain your problems.

Please copy two or three of your movies to a seperate directory and create a new test section. Then please post a directory listing including subdirs of this directory and the log file of the agent.

The .plexignore support seems to be a good idea however, so I'll merge it into the agents.

edit:

Its not possible to use the ignore function from the other thread in the agents. Plex calls the agents for every file it finds. There is no subdirs attribute to exclude things from.

Hi to y'all ...
I downloaded this and found it pretty much perfect, so I decided to improve it to match my needs.
I also did the thing with github - fork - pull to send my changes to the original dev.

I don't know whether he'll accept them or not though, so I'll post them here for anyone who might want/need them.

For Movies:

Fixes: DLNA poster, Rating & MPAA Rating

[spoiler]DLNA poster:
Get poster from movie_name.jpg (many DLNA servers/clients work this way)

Rating:
Work with Ratings that have commas e.g. 8,6 (for countries that use comma as decimal symbol instead of dot)

MPAA Rating:
Work for both "Rated bla" and "Rated bla blu" (the previous didn't work for "Rated bla")
Also added missing ratings for tv & non-rated movies[/spoiler]

For TV Shows:

Missing Info | Fixes: Rating, Poster, Episode(Date, Thumb) | Clean Up

[spoiler]

Missing Info Added:
Show: Original Name, Tagline, Set & Genre
Episode: Rating, Director & Writers

Show Rating:
Works also for comma instead of dot & generally works (plex didn’t read it because it wasn’t float)

Season Poster:
Can read from Season/folder.jpg (supported by DLNA & media browsers)

Episode Date:
Works with ‘aired’ instead of ‘releasedate’ (xbmc nfo has aired on episodes)

Episode Thumb:
Can read it for episode_name.jpg (supported by DLNA & media browsers)

Clean Up:
indent: comment format because it gave critical
runtime: eduration = eduration_min = eduration_ms = 0 (to be able to log the rest, because it gave critical)
episode thumb: names instead of paths given to episode.thumbs[thumbFilename]
poster & thumb: ‘elif’ instead of just ‘if’ (no reason to go further if found)[/spoiler]

@Crazyrabbit:

Guillaume is normally pretty quick in accepting changes that make sense. :) And as your changes do make a lot of sense, he has already merged them. :)

From me a big Thank You! Your changes take the agents a big step forward again.

You're welcome, I'm happy to have helped.


I only installed PMS yesterday and because I'm an organization freak :rolleyes: ,

I couldn't stand having missing information / images.

If anyone has any requests I'd be happy to hear them,

although I should tell you beforehand that I probably won't be actively developing.

Hey Crazy Rabbit,

correct me if i am wrong, but your change for mpaa ratings will ignore other ratings (not US/UK) and change it to NR?

All my Ratings are German FSK ratings, and this wouldnt be nice if they will be changed to NR. ;-)

Nice day

@SirG

My issue ended up customer scanner file gets deleted every morning (not that this agent overwrites it).   So it's not a problem with this agent at all...it's a problem with my scanner auto update and it is documented in that thread and figure out how to write a custom scanner.  Being this is only my 48th hour using Plex, I'm still learning.  I appreciate your assistance and quick response and will flush out the details on that thread.

http://forums.plexapp.com/index.php/topic/45094-modifying-commonvideofilepy-to-ignore-local-trailers/

John

PS - Thanks @Crazyrabbit for the metadata update :)

Hey Crazy Rabbit,

correct me if i am wrong, but your change for mpaa ratings will ignore other ratings (not US/UK) and change it to NR?

All my Ratings are German FSK ratings, and this wouldnt be nice if they will be changed to NR. ;-)

Nice day

Thanks for pointing out, didn't know there were other ratings. :blink:
I made new changes to get any rating regardless of the classics.

Update: Made a few more changes to the Content Rating,

now it supports most of the ratings from other countries,

according to wikipedia's article: Motion picture rating system