'Removes book from the result cache and the underlying database.
If you set commit to False, you must call clean() manually afterwards'

def delete_book(self, id, notify=True, commit=True, permanent=False, do_clean=True):

    try:
        path = os.path.join(self.library_path, self.path(id, index_is_id=True))
    except:
        path = None
    if (path and os.path.exists(path)):
        self.rmtree(path, permanent=permanent)
        parent = os.path.dirname(path)
        if (len(os.listdir(parent)) == 0):
            self.rmtree(parent, permanent=permanent)
    self.conn.execute('DELETE    FROM    books    WHERE    id=?', (id,))
    if commit:
        self.conn.commit()
        if do_clean:
            self.clean()
    self.data.books_deleted([id])
    if notify:
        self.notify('delete', [id])
