|
|
#1 |
|
Enthusiast
![]() Posts: 49
Karma: 10
Join Date: Jul 2019
Device: none
|
metadata plugin how to set custom fields
I'm trying to make my own personal metadata plugin but I'm not able to find out how to set a custom column value. I can do Metadata.authors and Metadata.tags etc.. but not metadata_info.set_user_metadata("#testColumn", "testvalue"). Any ideas how I can achive this without dipping into the db?
Code:
def identify(self, log, result_queue, abort, title=None, authors=None, identifiers={}, timeout=30):
log(f"Searching for metadata: {title}")
metadata_info = Metadata("test123")
metadata_info.authors = ["Unknown Author", "Another Author"]
metadata_info.tags = ['Example', 'Calibre']
metadata_info.comments = 'This is a test.'
metadata_info.set_user_metadata('#testColumn', "testvalue")
result_queue.put(metadata_info)
|
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,622
Karma: 28549046
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
IIRC metadata plugins dont support setting custom metadata. This is because they have to work with arbitrary libraries and so dont depend on non-builtin columns.
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Enthusiast
![]() Posts: 49
Karma: 10
Join Date: Jul 2019
Device: none
|
ah ok, guess db is the only way then. I have a script that takes the book ids and puts in the metadata in those custom fields using the db, but everytime I do this calibre needs a restart to reflect those changes on the interface
|
|
|
|
|
|
#4 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
You can do this with a User Interface plugin, an Action Chains python action, or a calibre python template.
|
|
|
|
|
|
#5 |
|
Junior Member
![]() Posts: 7
Karma: 10
Join Date: May 2015
Device: eBook Reader
|
Iam also searching for a way to do that, in which function is this prevented that custom user metadata is not saved? I would be not afraid to monkey patch it or so.
|
|
|
|
| Advert | |
|
|
![]() |
| Tags |
| plugin, python |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Metadata plugini set custom fields | Luftzug | Development | 6 | 05-04-2024 11:00 PM |
| Calibre's Basic metadata with custom metadata fields | MichaelSarri | Calibre | 2 | 04-15-2020 04:59 AM |
| Adding custom metadata fields | sutzig | Library Management | 5 | 03-20-2019 09:52 PM |
| Read custom fields from metadata plugin | Manitu80 | Development | 3 | 10-26-2016 11:59 PM |
| Access custom fields from metadata DB | JupiterJones | Development | 2 | 10-22-2014 08:48 AM |