Hey guys,
sorry to bother you. I know that I am a little late to the party, but since no official way is known to add custom metadata to Plex movie objects in Libraries is known (other than local metadata) programmatically, I am still bound / stuck to the legacy Plex agents.
With the “legacy” way of adding metadata, you have agents and scanners… and possibly supporting metadata scrapers, too.
In python, a supporting scraper could be defined by using the following code:
class MyAgent(Agent.Movies):
name = 'MyAgent'
languages = ['en']
primary_provider = False
contributes_to = ['com.plexapp.agents.imdb']
...
The primary_provider and the contributes_to statements would define, that the classic IMDB agent was used with MyAgent potentially adding metadata to this.
The special thing here: If the supporting agent did not add a certain metadata (let’s say the title of a movie), then the metadata from the IMDB agent was used.
The same is true - for example - for trailers and other extras.
My question is:
Is there a working way of accessing metadata provided by the “main” agent from within the supporting agent?
I found the following code in another 3rd party agent, but it did not work in mine:
def update(self, metadata, media, lang):
freebase_metadata = metadata.contribution('com.plexapp.agents.imdb')
I want to check all given extras of a movie and only keep those if the spoken language is the library language.
I though I could access the metadata.extras … but it seems to be empty (even if extras were found).
How can I read-access extras found by another agent from Python?