08-29-2012, 06:27 AM | #1 |
Zealot
Posts: 109
Karma: 419
Join Date: Aug 2012
Location: Spain
Device: Kindle Touch
|
Best way to locate a book id from title, author or another data?
I'm working in a plugin to update books from one library.
I load a catalog from a file, and then I need to search the database for those books. But I have no IDs, but titles, authors or another data. In fact, I have an unique number for each book, but it's not calibre ID, but a custom column ID. I know I can load all IDs from db in a list, and then use db.title, db.authors or db.xxx to locate the ID for the books (I suppose it must also be any other function for locating a book ID using a custom column ¿?). But... I think there must be a more eficcient way to do this. Any help? Last edited by Pepin33; 08-29-2012 at 06:34 AM. |
08-29-2012, 06:38 AM | #2 |
creator of calibre
Posts: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
search_getting_ids() uses the same syntax as the search interface in the main calibre window.
|
08-29-2012, 07:32 AM | #3 |
Zealot
Posts: 109
Karma: 419
Join Date: Aug 2012
Location: Spain
Device: Kindle Touch
|
Thank you very much. Works OK.
Is there any reference for calibre's objects and function?. If not, what file at Calibre's sources has the functions description for working with db object? |
08-29-2012, 07:44 AM | #4 |
creator of calibre
Posts: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
library/[database2,caches].py. As described in the code layout section of the setting up a development envorinment part of the user manual. http://manual.calibre-ebook.com/deve...ml#code-layout
|
08-29-2012, 07:56 AM | #5 |
Zealot
Posts: 109
Karma: 419
Join Date: Aug 2012
Location: Spain
Device: Kindle Touch
|
Thanks again for the super-fast answer.
You're right, I was looking at the manual, but I was looking at the wrong sections ("API plugins" and "create plugins"). |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Searching for author or title of book | Kraftwerk | Library Management | 4 | 03-13-2012 08:11 AM |
Help! Need title/author of old sci-fi book about... | macgirl | Reading Recommendations | 16 | 03-02-2012 11:28 PM |
Editing author and title meta data | jflatto | Calibre | 16 | 06-24-2010 05:41 PM |
looking for a book title and author | Joebill | Reading Recommendations | 16 | 05-23-2010 06:07 AM |
Regex search author field to locate books? | Starson17 | Calibre | 2 | 12-21-2009 10:40 AM |