Writing a Metadata Agent

Is this possible or even a good idea?
After hitting a zero with finding something that allows the UK Content Ratings to be extracted instead of the US ones, I wonder if a new plug-in could be written?

The thought is not to duplicate any of the other agents, but simply have an Agent called, say, UK_Content_Ratings, which had one job to do and that would be take the movie returned by another Agent and look up the UK Rating from the web, replacing what was returned by the previous agent.

Not knowing Plug-ins, is this a reasonable approach (and an easy one to write) and if so, has anyone done anything similar to this or can offer any getting started pointers?

Thanks

Phil

This is actually a fully legitimate use of an agent. They are allowed to provide just a single field, and as long as it’s the highest priority, that field will “win” when the metadata is combined.

Does anyone have an example code to get me going with writing an agent - or is there some resources on the wiki on writing agents (as opposed to writing channels)?



Thanks



Phil



Take a look at the default metadata plug-ins. If you are on Mac, they may be in ~/Library/Application Resources/Plex Media Server/Plug-ins. I guess, MoviePosterDB.bundle could be a good example since it provides only two fields (poster and background art) to results found by another plugin (IMDB.plugin). Look through unsupported plugins, you may find other useful examples there: http://wiki.plexapp.com/index.php/Unsupported_plugins

Also, check for more info on the Plex dev center: http://dev.plexapp.com/

Good luck.


Phil,

What movie agent do you use by default? You'll probably want to start with that agent and find where it retrieves the content rating. For example, the IMDB agent retrieves a metadata element called content_rating (though it's using Freebase, not IMDB, I think). You'll then need to find API documentation for the agent's metadata source and determine the name of the UK rating element (if any) and retrieve it. UK ratings exist for **some** but not all movies, so you'd probably want to write code for fallbacks if the UK rating is not available.

Hope that helps. Good luck.

UPDATE: This thread might help: http://forums.plexapp.com/index.php/topic/23875-uk-film-ratings-pg-12-15-etc/

Thanks for that - will have a look when I get some time (been too too busy recently to get time to reverse engineer this).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.