View Single Post
Old 03-07-2012, 12:43 PM   #295
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,332
Karma: 3966377
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Deleted/Dup Check on Eject?

I'm toying with an idea for a new plugin and could use some advice.

When I decide I don't want to read a particular ebook after all, I delete it from the calibre library. So I end up with books on my devices that I don't want anymore. Less frequently, the same book on a device will end up on the device more than once.

While it's easy enough to find dups and deleted books manually, I frequently forget to check before I eject the device.

So I was thinking of a plugin that when invoked would check for deleted books on device (search inlibrary:False) and duplicates (search ondevice:"(") and then alert me. Or eject the device if none are found.

Is there already a way to do this? I don't want to duplicate effort.

Also, I haven't figured out a way to do the "inlibrary:False" on search from code. Any advice? I expect I'll have to do it separately for memory_view, card_a_view and card_b_view.

Here's what I've found for the dup search:
Spoiler:
Code:
print("library Dups:%s"% self.gui.library_view.model().db.search_getting_ids('ondevice:"("', None))

And the eject:
Spoiler:
Code:
self.gui.location_manager._eject_requested()

Any better suggestions for those?

Thanks,
Jim
JimmXinu is online now   Reply With Quote