|
|
#1 |
|
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Jun 2016
Device: Kobo aura hd
|
learning about calibre-debug
I'm trying to run some batch jobs using python and calibre-debug -c
command = ( f"from calibre.library.database2 import LibraryDatabase2; " f"db = LibraryDatabase2('/Calibre/'); " f"db.conn.execute('UPDATE books_languages_link SET lang_code={lang_id} WHERE book={book_id}'); " f"db.conn.execute('UPDATE custom_column_4 SET value=1 WHERE book={book_id}'); " f"db.conn.commit();" I suppose that this does not do anything if there is not already a language populated nor a custom_column_4 entry made for this particular book (like an upsert). Is there a more intelligent way to do this that directly checks if this needs updating or inserting via calibre-debug? I've seen some nice ones in this forum.. but I don't understand the syntax is there a sort of guide on how to construct these statements properly? many thanks for your help! Last edited by mpegman; 10-17-2024 at 02:20 PM. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| calibre-debug on Mac | scop | Calibre | 3 | 10-03-2023 10:47 AM |
| how to exit calibre-debug | botmtl | Development | 4 | 08-26-2018 02:15 AM |
| Cannot run calibre-debug -g | Chaaang | Development | 6 | 05-26-2017 07:10 AM |
| Best way to debug Calibre crash? | DMcCunney | Devices | 8 | 05-14-2017 10:23 PM |
| Ctrl-Shft-R Debug vs calibre-debug -g | JimmXinu | Development | 3 | 11-20-2014 10:57 AM |