Add another method to the custom data API. get_ids_for_custom_book_data('name') returns all books with data named 'name'

This commit is contained in:
Charles Haley 2010-12-31 19:43:47 +00:00
parent 67028bd368
commit ac38246909

View File

@ -2728,6 +2728,10 @@ books_series_link feeds
(book_id, name)) (book_id, name))
self.commit() 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): def get_custom_recipes(self):
for id, title, script in self.conn.get('SELECT id,title,script FROM feeds'): for id, title, script in self.conn.get('SELECT id,title,script FROM feeds'):
yield id, title, script yield id, title, script