Hello - I was browsing through the plugin logs for my custom Agent code and came across a critical error which Im not sure exactly what it means and how to attempt to fix it. It doesn't seem to be affecting the code for the most part (all metadata, posters, etc. show up) but There are a few cases where the shows don't populate full metadata from the source, when the metadata does in fact exists. This is the only error that seems to point to a possible culprit:
Error:
CRITICAL (core:561) - Exception in the search function of agent named 'SageTV BMT Agent (TV Shows)', called with keyword arguments {'openSubtitlesHash': '57fce635f544e009', 'episode': '12', 'name': 'Welcome to Alancrest', 'episodic': '1', 'show': 'Two and a Half Men', 'season': '10', 'filename': '%5C%5C192%2E168%2E1%2E110%5CConvSage%5CTwoandaHalfMen-S10E12-WelcometoAlancrest-15292365-0%2Eavi', 'plexHash': '51e4101450d59cfb53c91b757652819737bf6b2b', 'duration': '-1', 'id': '53330'} (most recent call last):
File "C:\Users\pix64\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 923, in _search
agent.search(results, media, lang)
TypeError: search() takes exactly 3 arguments (4 given)
Agent Search Function:
def search(self, results, media, lang, manual):
#filename = media.items[0].parts[0].file.decode('utf-8')
Log.Debug("****STARTTTTTTTT")
if(not readPropertiesFromPropertiesFile()):
Log.Debug("****UNABLE TO READ BMTAGENT.PROPERTIES FILE... aborting search")
quotedFilepathAndName = media.filename
Log.Debug('****media.id=%s; media.filename=%s' % (str(media.id), quotedFilepathAndName))
unquotedFilepathAndName = urllib.unquote(quotedFilepathAndName)
# Pull out just the filename to use
unquotedFilename = getFilenameOnly(unquotedFilepathAndName)
Log.Debug('****unquotedFilepathAndName=%s' % unquotedFilepathAndName)
Log.Debug('****unquotedFilename=%s' % unquotedFilename)
(filename, ext) = os.path.splitext(unquotedFilename)
Log.Debug('****filename = %s' % filename)
mf = getMediaFileForFilePath(filename)
if(mf): # this would only return false if there is a file on the Plex import directory but that file is not yet in Sage's DB
airing = mf.get('Airing')
show = airing.get('Show')
# Check if the Sage recording is a movie or film; if it is, ignore it (workaround for user is to move movies out to a separate import directory that Plex can read an import as Movie content vs. TV Show content
category = show.get('ShowCategoriesString')
if(category.find("Movie")<0 and category.find("Movies")<0 and category.find("Film")<0):
startTime = float(show.get('OriginalAiringDate') // 1000)
airDate = date.fromtimestamp(startTime)
mfid = str(mf.get('MediaFileID'))
results.Append(MetadataSearchResult(id=mfid, name=media.show, score=100, lang=lang, year=airDate.year))
else:
Log.Debug('***Movies/Movies/Film found, ignoring and will not call update; categorylist=%s' % category)
Any ideas which may point me in the direction of a possible fix?