How to hack localmedia agent the right way?

Hi there. I want my DB to fetch TMDB/Freebase metadata except for posters. I have my own local posters. Today I found a way of doing this by copying/renaming the localmedia agent, hacking it slightly, and adding it to file “themoviedb-combiner-movies.xml”
Apparently this works. I see my posters and the info comes from the Internet.

Since I have basically no idea of what I am doing, and I suspect my mod will be destroyed by the next update of PMS, I thought some kind soul would provide guidance on the right way of doing this: a minimal agent to get posters from local assets, with top priority.

Thanks in advance.

you can just copy the agent in /Plex Media Servers/Plug-ins/customlocalmedia.bundle/Contents/Code/init.py otherwise it will be overwritten randomly upon plex restart for example. you will need surounding files and folders but that’s about it…