mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Do not send out notifications when applying metadata
This commit is contained in:
parent
0bec074f80
commit
fc3280d96a
@ -469,6 +469,13 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
|
|
||||||
def apply_metadata_changes(self, id_map,
|
def apply_metadata_changes(self, id_map,
|
||||||
title=_('Applying changed metadata'), msg=''):
|
title=_('Applying changed metadata'), msg=''):
|
||||||
|
'''
|
||||||
|
Apply the metadata changes in id_map to the database synchronously
|
||||||
|
id_map must be a mapping of ids to Metadata objects. Set any fields you
|
||||||
|
do not want updated in the Metadata object to null. An easy way to do
|
||||||
|
that is to create a metadata object as Metadata(_('Unknown')) and then
|
||||||
|
only set the fields you want changed on this object.
|
||||||
|
'''
|
||||||
self.apply_id_map = list(id_map.iteritems())
|
self.apply_id_map = list(id_map.iteritems())
|
||||||
self.apply_current_idx = 0
|
self.apply_current_idx = 0
|
||||||
self.apply_failures = []
|
self.apply_failures = []
|
||||||
@ -494,7 +501,7 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
set_title = not mi.is_null('title')
|
set_title = not mi.is_null('title')
|
||||||
set_authors = not mi.is_null('authors')
|
set_authors = not mi.is_null('authors')
|
||||||
db.set_metadata(i, mi, commit=False, set_title=set_title,
|
db.set_metadata(i, mi, commit=False, set_title=set_title,
|
||||||
set_authors=set_authors)
|
set_authors=set_authors, notify=False)
|
||||||
self.applied_ids.append(i)
|
self.applied_ids.append(i)
|
||||||
except:
|
except:
|
||||||
import traceback
|
import traceback
|
||||||
|
@ -1756,7 +1756,8 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
return books_to_refresh
|
return books_to_refresh
|
||||||
|
|
||||||
def set_metadata(self, id, mi, ignore_errors=False, set_title=True,
|
def set_metadata(self, id, mi, ignore_errors=False, set_title=True,
|
||||||
set_authors=True, commit=True, force_changes=False):
|
set_authors=True, commit=True, force_changes=False,
|
||||||
|
notify=True):
|
||||||
'''
|
'''
|
||||||
Set metadata for the book `id` from the `Metadata` object `mi`
|
Set metadata for the book `id` from the `Metadata` object `mi`
|
||||||
|
|
||||||
@ -1865,7 +1866,8 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
label=user_mi[key]['label'], commit=False)
|
label=user_mi[key]['label'], commit=False)
|
||||||
if commit:
|
if commit:
|
||||||
self.conn.commit()
|
self.conn.commit()
|
||||||
self.notify('metadata', [id])
|
if notify:
|
||||||
|
self.notify('metadata', [id])
|
||||||
|
|
||||||
def authors_sort_strings(self, id, index_is_id=False):
|
def authors_sort_strings(self, id, index_is_id=False):
|
||||||
'''
|
'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user