Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 08-29-2012, 06:27 AM   #1
Pepin33
Zealot
Pepin33 has a complete set of Star Wars action figures.Pepin33 has a complete set of Star Wars action figures.Pepin33 has a complete set of Star Wars action figures.Pepin33 has a complete set of Star Wars action figures.Pepin33 has a complete set of Star Wars action figures.
 
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.
Pepin33 is offline   Reply With Quote
Old 08-29-2012, 06:38 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 08-29-2012, 07:32 AM   #3
Pepin33
Zealot
Pepin33 has a complete set of Star Wars action figures.Pepin33 has a complete set of Star Wars action figures.Pepin33 has a complete set of Star Wars action figures.Pepin33 has a complete set of Star Wars action figures.Pepin33 has a complete set of Star Wars action figures.
 
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?
Pepin33 is offline   Reply With Quote
Old 08-29-2012, 07:44 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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
kovidgoyal is offline   Reply With Quote
Old 08-29-2012, 07:56 AM   #5
Pepin33
Zealot
Pepin33 has a complete set of Star Wars action figures.Pepin33 has a complete set of Star Wars action figures.Pepin33 has a complete set of Star Wars action figures.Pepin33 has a complete set of Star Wars action figures.Pepin33 has a complete set of Star Wars action figures.
 
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").
Pepin33 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 01:30 AM.


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