From ac38246909ffefaca293473b8266183c15956ae0 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Fri, 31 Dec 2010 19:43:47 +0000 Subject: [PATCH] Add another method to the custom data API. get_ids_for_custom_book_data('name') returns all books with data named 'name' --- src/calibre/library/database2.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index cd3c44387b..0a0d322ab5 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -2728,6 +2728,10 @@ books_series_link feeds (book_id, name)) self.commit() + def get_ids_for_custom_book_data(self, name): + s = self.conn.get('''SELECT book FROM books_plugin_data WHERE name=?''', (name,)) + return [x[0] for x in s] + def get_custom_recipes(self): for id, title, script in self.conn.get('SELECT id,title,script FROM feeds'): yield id, title, script