Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 12:08 PM   #1
revjoe
Junior Member
revjoe began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jul 2011
Device: none
First Plugin

I am working on writing my first plugin and am confused about the nature of the db object in an add on and the db.new_api. I am writing a user interface plugin to merge books while maintaining all the formats and metadata from the merged book.

I have hacked it together and it works for my purpose, but it seems like in some commands I needed to use db and others db.new_api.

Is there a best practice on when to use one over the other?
Is on expected to be deprecated and we should move to the other?

Thanks
Joe
revjoe is offline   Reply With Quote
Old Yesterday, 01:58 PM   #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: 45,449
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Always use db.new_api. You only need to use db itsefl if you are dealing with the view of books in the calibre UI.
kovidgoyal is online now   Reply With Quote
Old Yesterday, 02:01 PM   #3
revjoe
Junior Member
revjoe began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jul 2011
Device: none
Awesome.. thanks for the quick response, I will review my code and make sure that's all I used.

Thanks

Joe
revjoe is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] LOI-Generator - edit] plugin to generate a List of Illustrations KevinH Plugins 1 01-19-2023 04:31 PM
[Metadata Source Plugin] Empty Plugin? (Fake Identifier) mneimeyer Plugins 3 11-11-2019 08:07 PM
[Plugin] QuickPrefsEdit - Edit plugin prefs json files. slowsmile Plugins 3 07-25-2018 08:14 PM
Goodread Perception Expander plugin not shown on plugin list (kobo h2o) www KOReader 4 09-28-2017 10:34 AM


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


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