01-27-2019, 11:57 PM | #1 |
Junior Member
Posts: 2
Karma: 10
Join Date: Jan 2019
Device: fbreader/android
|
plugin api call to do editmetadata->merge functions?
I'm playing around with a plugin that does some custom duplicate finding (yeah I know about the existing duplicate finder plugin) and I'd like to, in some cases be able to make a db api call that does the same thing as 'edit metadata'->'merge' from the menu or 'M' keypress.
Is that function exposed via the api that plugins can call? |
01-28-2019, 01:08 AM | #2 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can do anything calibre itself can do from a plugin, there is no API that is not accessible. For instance if you want to trigger the merge action from your plugin, you can do:
Code:
self.gui.iactions['Edit metadata'].merge_books() |
Advert | |
|
01-28-2019, 08:27 AM | #3 |
Junior Member
Posts: 2
Karma: 10
Join Date: Jan 2019
Device: fbreader/android
|
So, looking at that code, I want to do this approximately:
self.add_formats(dest_id, self.formats_for_books(rows)) self.merge_metadata(dest_id, src_ids) self.delete_books_after_merge(src_ids) Can I just import those (and any they use) methods from that file? Are they already accessible somewhere? deep in the self.gui object? |
01-28-2019, 09:45 AM | #4 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
self.gui.iactions['Edit metadata']
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Suggestion: Plugin API exposing basic metadata | AlPe | Plugins | 11 | 12-14-2015 02:05 PM |
calibre's new plugin API | kovidgoyal | Plugins | 26 | 05-07-2011 02:43 PM |
Small Change to Metadata Source plugin API | kovidgoyal | Development | 2 | 04-25-2011 02:55 PM |
Metadata scraper plugin api | kiwidude | Development | 5 | 03-06-2011 11:58 AM |
Ubook plugin api | Dopedangel | Reading and Management | 0 | 08-25-2007 06:54 AM |