View Single Post
Old 12-29-2018, 10:18 PM   #10
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: 36,107
Karma: 15014853
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you are doing this in a GUI plugin then dont use the db API directly, instead use the existing remove books action which will take care of refreshing the GUI for you automatically. Something like:


Code:
self.gui.iactions['Remove Books'].remove_format_by_id(book_id, fmt)
Note however, that this function will ask the user for confirmation. If you want to avoid that, then look at its code and re-implement it yourself, you will find it in actions/delete.py
kovidgoyal is offline   Reply With Quote