![]() |
#1 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: May 2025
Device: iPad Mini
|
automatically changing metadata field
I'm looking to make a plugin that seems fairly simple, but I can't figure out how to go about it. I want it to, every time a specific custom metadata field is changed, change the "Title sort" metadata field to be identical to that custom metadata field. Reading and changing metadata fields seems straightforward enough from the API documentation, but I don't see how I would get it to trigger on a metadata field being changed. I have some very basic Python experience, enough to fumble my way through the API docs, but zero experience with calibre plugins or any kind of real development. Is something like this at all possible?
|
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,163
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You use the add_listener() function of the db api to add a callback that is called on various events including metadata change. But be careful not to do much work in the allback as this would tank performance and also dont change metadata in the callback itself as that would lead to infinite recursion. Instead use a different thread or if its a GUI plugin an qt signal to do your changes asynchronously.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Automatically load 'template' into Comments field? | CloudReader | Library Management | 12 | 12-19-2023 08:37 PM |
How do I stop calibre from changing metadata automatically? | pkax | Calibre | 13 | 10-30-2022 11:13 AM |
Calibre fills automatically title and author metadata in books without any metadata? | thosedays | Library Management | 5 | 10-28-2016 03:33 PM |
How to Stop Calibre from Automatically Changing OPF metadata | Sneddles | Conversion | 10 | 07-19-2014 06:57 PM |
Automatically populating metadata "tags" field from directory structure | battaglia01 | Calibre | 1 | 12-13-2012 09:23 PM |