Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
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
Old 06-17-2024, 05:42 PM   #2
yamusing
Enthusiast
yamusing began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Jul 2019
Device: none
well nvm found out how to do it by using chatgpt
yamusing is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Restore not working iondream Calibre 9 11-24-2023 12:08 AM
How can I use the database API to get a collection of all known series? charlweed Development 2 03-06-2023 04:44 PM
Problems using Calibre 3.15.0 Database API einnordlicht Development 2 01-06-2018 09:28 PM
Arc Google maps api v2 is not working in kobo arc Angel Shah Kobo Tablets 3 05-29-2013 11:27 AM
Database ids when working with devices kiwidude Development 1 06-20-2011 12:34 PM


All times are GMT -4. The time now is 07:39 AM.


MobileRead.com is a privately owned, operated and funded community.