mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-30 08:24:56 +01:00
When using the set_* APIs to change case, mark all affected books as dirtied
This commit is contained in:
parent
23fa68ce8a
commit
8eda01abc2
2 changed files with 5 additions and 5 deletions
|
|
@ -445,7 +445,7 @@ def set_custom(self, id, val, label=None, num=None, append=False,
|
|||
rv = self._set_custom(id, val, label=label, num=num, append=append,
|
||||
notify=notify, extra=extra,
|
||||
allow_case_change=allow_case_change)
|
||||
self.dirtied([id], commit=False)
|
||||
self.dirtied(set([id])|rv, commit=False)
|
||||
if commit:
|
||||
self.conn.commit()
|
||||
return rv
|
||||
|
|
|
|||
|
|
@ -1692,7 +1692,7 @@ def set_authors(self, id, authors, notify=True, commit=True,
|
|||
'''
|
||||
books_to_refresh = self._set_authors(id, authors,
|
||||
allow_case_change=allow_case_change)
|
||||
self.dirtied([id], commit=False)
|
||||
self.dirtied(set([id])|books_to_refresh, commit=False)
|
||||
if commit:
|
||||
self.conn.commit()
|
||||
self.set_path(id, index_is_id=True)
|
||||
|
|
@ -1768,7 +1768,7 @@ def set_publisher(self, id, publisher, notify=True, commit=True,
|
|||
self.conn.execute('''DELETE FROM publishers WHERE (SELECT COUNT(id)
|
||||
FROM books_publishers_link
|
||||
WHERE publisher=publishers.id) < 1''')
|
||||
books_to_refresh = set()
|
||||
books_to_refresh = set([])
|
||||
if publisher:
|
||||
case_change = False
|
||||
if not isinstance(publisher, unicode):
|
||||
|
|
@ -1793,7 +1793,7 @@ def set_publisher(self, id, publisher, notify=True, commit=True,
|
|||
bks = self.conn.get('''SELECT book FROM books_publishers_link
|
||||
WHERE publisher=?''', (aid,))
|
||||
books_to_refresh |= set([bk[0] for bk in bks])
|
||||
self.dirtied([id], commit=False)
|
||||
self.dirtied(set([id])|books_to_refresh, commit=False)
|
||||
if commit:
|
||||
self.conn.commit()
|
||||
self.data.set(id, self.FIELD_MAP['publisher'], publisher, row_is_id=True)
|
||||
|
|
@ -2206,7 +2206,7 @@ def set_tags(self, id, tags, append=False, notify=True, commit=True,
|
|||
bks = self.conn.get('SELECT book FROM books_tags_link WHERE tag=?',
|
||||
(tid,))
|
||||
books_to_refresh |= set([bk[0] for bk in bks])
|
||||
self.dirtied([id], commit=False)
|
||||
self.dirtied(set([id])|books_to_refresh, commit=False)
|
||||
if commit:
|
||||
self.conn.commit()
|
||||
tags = u','.join(self.get_tags(id))
|
||||
|
|
|
|||
Loading…
Reference in a new issue