Help or support building new agent ?

Hi guys,

I’m building a new metadata agent for a fan blog that i like (wipfilms.net).

To clear the coast : i’m not a python expert, but a competent dev

so here’s what i have :

-My agent shows up in plex, and i can create a library that uses it for metadata
-I can scrape it and get results, and the score is handled well for auto-matching
-I can also search in the UI and select the appropriate movie there
-My logs show that the data is downloaded from the blog and gets into those “/Metadata/Movies//.bundle/Contents//Info.xml” files when an update is triggered

BUT

-The Metadata never makes it into the plex UI (??)

My questions :

-Could this be language related ? does the “lang” parameter have an impact on update and what do i need to supply to make it work ?
-Could this be encoding related ? I saw random utf-8 encoding error popping in my logs on deserializing of those xml files, but htis does not seem to be related to the metadata not showing up (some movies pop those errors, others don’t, but no metadata ever shows up…)
-OR could this be <insert-your-hypothesis-here-cause-it’s-as-good-as-mine> related ?

Also a couple of debugging related questions :

-How to avoid plex caching the metadata ? (update seems to trigger randomly, my current solutions is switching files and testing other files)
-How to force a metadata update ? (same problem)
-What’s the agents workflow ? (Some movies go through com.plex.agents.none even though my library is not configured for this one)
-Is there a Metadata Agent Development doc or tuto available ? Best practices ? Dedicated support ? Ninja power-user support ?

Thank you all
Greg

if you did that much, you should post a link of the current version

  • language used if you used it… i put en by default and use other sets of settigns in agent to select language for summaries and titles
  • if update() called at all according to agent logs? put a check output in your code to check
  • encoding? well do you have a python error in your agent logs ? use the functions in my anime agent if oyu need
  • you can set up the cache or lack of in the agent
  • force refresh the library
  • ???
  • Doc https://web.archive.org/web/20140107030832/https://dev.plexapp.com/

Somebody else complained movies didn’t had metadata updated, maybe a global issue

Dude, i did no big thing, just copy pasted from someone else’s plugin, changed the plugin id and customized a bunch or urls, regexes and xpath… I don’t see the point in sharing as long as it’s not functional…

On to your points,
-so lang isn’t the issue, thanks :wink:
-yes, it gets called, i have a log at the start of it to check what params are passed, the issue is downstream from that
-no encoding errors in my logs, decoding issues sometimes appear in com.plexapp.system.log complaining it couldn’t deserialize the info.xml, i repeat this is only sometimes, this is inconsistent, so movie metadata without any issues don’t show up either…
-ok, thanks, i kinda thought it was, but i lack the variable to set it and the values i can set it to, i’ll check with the doc again
-force refresh doesn’t consistently call update(), that’s why i’m asking…
-i believe in some situations (movie previously indexed in another library for example) the update() workflow bypasses my agent’s update() and considers previous metadata to be sufficient. I thought someone might have more info on this
-thanks, i found those, but they’re badly outdated and lack a lot of context, i’ll try to make do thought…

Anyway, thanks for the infos, if they’re not decisive, at least i feel i’m making progress :wink:

Have a look at my agent. It does movies and series and use a lot of simple and cistom code

Gosh, believe me you did quite a lot of code :wink:

Two more days wasted testing and my meticulously collated data still doesn’t show up… around 200 lines of significant code…

Here’s what i have for now, it grabs title, summary, duration and poster from the blog, code is correct if not pretty, data shows up in the logs, but nada on the UI, if you could have a look and tell me why it’s not working, otherwise i’ll be giving up :frowning:

Just deactivated the debug logs on my server, things suddenly become readable…

Anyone knows more about this warning in “Plex Media Server.log”

WARN - Error refreshing metadata for (movie guid)

Nothing else shows up…

created test library
file: The Casino Job (2009).mp4 (real file, size zero files skipped by movie scanner)
there is an error that prevent the metadata refreshng
i would set by hand values from zero to check metadata setting work, then replace with the data you gathered.
some coding issue maybe. solved a year issue utf8 space was present, replaced the space replacement with strip function

Hi, and thanks for testing it.

Did as you said and hardcoded the metadata, still no good, still the “WARN” in Plex Media Server.log

???

going to japan next week so little time…
Will try to dig deep into it again and first put nothing in update and see if there is errors then add back bit by bit. wil lrecheck from the config option file to the code file…

No hurry there, thanks for taking the time to check it.
Already tried clearing the update function and putting it back piece by piece, (you can see it from the parts that are still commented out) but will try again sometime this week.
Have a nice trip and thank you again.

Somebody else had the same issue. Did from their code a default agent
See https://forums.plex.tv/discussion/comment/1150952/#Comment_1150952