I am coding a simple tv show agent. Everything works great except i cannot reset or set the thumbnail of the episode.
My code looks currently like this. I cannot find any documentation on how to delete thumbnails via code and start over. I can see that the found thumbnail is there when i edit the episode via the ui but its not the selected one.
def update_thumbnail(self, episode, filepath):
for extension in [".webp", ".jpg", ".jpeg", ".png", ".tiff", ".gif", ".jp2"]:
maybeFile = filepath + extension
if os.path.isfile(maybeFile):
try:
picture = Core.storage.load(maybeFile)
media = Proxy.Media(picture, sort_order=0)
episode.thumbs['main'] = media
except Exception as e:
Log(e)
The selected one is wrong. It should be the third one but my code does not set it.
It took a long time for the curl request to go through. Then the sever hang like crazy. But still no success with the thumbnails. The selected one stays the selected one.
Be advised that the Python agents are a dead end. They are deprecated for years now.
Apparently your agent is not a primary agent, but a secondary one.
Which means that it merely augments the data of the primary agent.
The order of the lines under Settings - Server - Agents - [library type] - [primary agent] is what decides which agent is preferred. The top one gets first shot.
If you want the data from your agent to be in first place, move it to the top position.