Merge from trunk

This commit is contained in:
Charles Haley 2010-08-18 21:33:24 +01:00
commit 6a4c47ca61
3 changed files with 9 additions and 4 deletions

View File

@ -53,7 +53,7 @@ class Worker(Thread):
# All of these just affect the DB, so we can tolerate a total rollback # All of these just affect the DB, so we can tolerate a total rollback
for id in self.ids: for id in self.ids:
if do_auto_author: if do_auto_author:
x = self.db.author_sort_from_book(id, index_is_id=True, commit=False) x = self.db.author_sort_from_book(id, index_is_id=True)
if x: if x:
self.db.set_author_sort(id, x, notify=False, commit=False) self.db.set_author_sort(id, x, notify=False, commit=False)
@ -76,8 +76,8 @@ class Worker(Thread):
self.db.remove_format(id, remove_format, index_is_id=True, notify=False, commit=False) self.db.remove_format(id, remove_format, index_is_id=True, notify=False, commit=False)
if do_remove_conv: if do_remove_conv:
self.db.delete_conversion_options(id, 'PIPE') self.db.delete_conversion_options(id, 'PIPE', commit=False)
self.db.doit.commit() self.db.commit()
for w in self.cc_widgets: for w in self.cc_widgets:
w.commit(self.ids) w.commit(self.ids)

View File

@ -1080,9 +1080,11 @@ ALTER TABLE books ADD COLUMN isbn TEXT DEFAULT "" COLLATE NOCASE;
return cPickle.loads(str(data)) return cPickle.loads(str(data))
return None return None
def delete_conversion_options(self, id, format): def delete_conversion_options(self, id, format, commit=True):
self.conn.execute('DELETE FROM conversion_options WHERE book=? AND format=?', self.conn.execute('DELETE FROM conversion_options WHERE book=? AND format=?',
(id, format.upper())) (id, format.upper()))
if commit:
self.conn.commit()
def add_format(self, index, ext, stream, index_is_id=False): def add_format(self, index, ext, stream, index_is_id=False):

View File

@ -1451,6 +1451,9 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
if notify: if notify:
self.notify('metadata', ids) self.notify('metadata', ids)
def commit(self):
self.conn.commit()
def set_tags(self, id, tags, append=False, notify=True, commit=True): def set_tags(self, id, tags, append=False, notify=True, commit=True):
''' '''
@param tags: list of strings @param tags: list of strings