View Single Post
Old 06-17-2024, 05:30 PM   #1
yamusing
Enthusiast
yamusing began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Jul 2019
Device: none
database API set_field not working

I am trying to edit a field such as the title field for a book through the python API so I am using the calibre-debug.exe to do it.

I do db.set_field("title", 18168) and tried db.set_field("title", [18168]) but it says AttributeError: 'list' object has no attribute 'items'.

I look at the documentation and it doesn't even list an example and find it quite hard to understand it compared to other API documentations I've seen.
here is what it says
set_field(name, book_id_to_val_map, allow_case_change=True, do_path_update=True)

I set the field name of "title" and passed the book id in a list. So I don't understand what I am doing wrong. Any ideas?
yamusing is offline   Reply With Quote