Metadata from my agent not being used?

I’ve been playing around with writing a metadata agent, as I couldn’t get the XBMC .nfo TV shows reader to work. The problem is, as far as I can tell the metadata is being correctly filled out in ~/Library/Application Support/Plex Media Server/Metadata , but only the TV Show level information is being read (i.e. individual episodes have no metadata, even though there is an entry in the show’s bundle).



I’m suspecting it has something to do with this:





i.e. in it’s own configuration, my new agent is not selected (and not selectable - it is grayed out), so it’s metadata updates are ignored. Is this a plausible explanation, and what have I done wrong to cause this? If not, what could it be?



My Info.plist is:


<?xml version="1.0" encoding="UTF-8"?><br />
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><br />
<plist version="1.0"><br />
<dict><br />
  <key>CFBundleExecutable</key><br />
  <string>Replacement Metadata Agent</string><br />
  <key>CFBundleIdentifier</key><br />
  <string>com.plexapp.agents.ReadNFO</string><br />
  <key>CFBundleDevelopmentRegion</key><br />
  <string>English</string><br />
  <key>CFBundleInfoDictionaryVersion</key><br />
  <string>6.0</string><br />
  <key>CFBundleShortVersionString</key><br />
  <string>1.0</string><br />
  <key>CFBundleSignature</key><br />
  <string>????</string><br />
  <key>CFBundleVersion</key><br />
  <string>1.0</string><br />
  <key>PlexFrameworkVersion</key><br />
  <string>2</string><br />
  <key>PlexPluginMode</key><br />
  <string>AlwaysOn</string><br />
  <key>PlexPluginClass</key><br />
  <string>Agent</string><br />
</dict><br />
</plist><br />




And the __init.py__:

import os, datetime<br />
<br />
def Start():<br />
  pass<br />
<br />
class ReadNfoAgent(Agent.TV_Shows):<br />
<br />
  name = 'Read NFO Agent'<br />
  languages = [Locale.Language.English]<br />
  primary_provider = True<br />
  accepts_from = None<br />
  contributes_to = ["com.plexapp.agents.none",]<br />
    <br />
  def search(self, results, media, lang, manual):<br />
    "Gives a list of possible matches to the detected automatic metadata"<br />
    Log("Starting Search")<br />
    Log(media.show)<br />
    Log(media.id)<br />
    results.Append(MetadataSearchResult(id=media.id,name=media.show,lang=lang,score=100))<br />
<br />
  def update(self, metadata, media, lang, force):<br />
    "Grabs all the information about the show and episodes"<br />
    Log("Starting Update")<br />
<br />
    metadata.title = "TEST TITLE"<br />
    metadata.summary = "THIS IS A SUMMARY"<br />
    @parallelize<br />
    def UpdateEpisodes():<br />
      # Full list of media parts...<br />
      for s in media.seasons:<br />
         Log("Season: "+ s)<br />
         for e in media.seasons[s].episodes:<br />
           Log("  Episode: " + e)<br />
           for i in media.seasons[s].episodes[e].items:<br />
             Log("    Item: " + str(i))<br />
             for part in i.parts:<br />
               Log("       Part: " + part.file)<br />
               filename = part.file.decode('utf-8')<br />
               nfoFile=os.path.splitext(filename)[0]+".nfo"<br />
              <br />
               episode = metadata.seasons[s].episodes[e]<br />
               <br />
               # Create a task for updating this episode<br />
               @task<br />
               def UpdateEpisode(episode=episode):<br />
                 episode.title = "TEST"<br />
                 episode.summary = "XXX"<br />
                 episode.rating = 50.<br />
                 episode.originally_available_at = datetime.date.today()

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