![]() |
#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,423
Karma: 27757236
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,465
Karma: 8025600
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.
|
![]() |
![]() |
![]() |
Tags |
plugin, python |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Metadata plugini set custom fields | Luftzug | Development | 6 | 05-04-2024 10:00 PM |
Calibre's Basic metadata with custom metadata fields | MichaelSarri | Calibre | 2 | 04-15-2020 03:59 AM |
Adding custom metadata fields | sutzig | Library Management | 5 | 03-20-2019 08:52 PM |
Read custom fields from metadata plugin | Manitu80 | Development | 3 | 10-26-2016 10:59 PM |
Access custom fields from metadata DB | JupiterJones | Development | 2 | 10-22-2014 07:48 AM |