diff --git a/src/calibre/gui2/dialogs/metadata_bulk.py b/src/calibre/gui2/dialogs/metadata_bulk.py index 3874f32b71..3aac439815 100644 --- a/src/calibre/gui2/dialogs/metadata_bulk.py +++ b/src/calibre/gui2/dialogs/metadata_bulk.py @@ -712,7 +712,8 @@ class MetadataBulkDialog(ResizableDialog, Ui_MetadataBulkDialog): dest_mode = self.replace_mode.currentIndex() if self.destination_field_fm['is_csp']: - if not unicode(self.s_r_dst_ident.text()): + dest_ident = unicode(self.s_r_dst_ident.text()) + if not dest_ident or (src == 'identifiers' and dest_ident == '*'): raise Exception(_('You must specify a destination identifier type')) if self.destination_field_fm['is_multiple']: @@ -816,13 +817,18 @@ class MetadataBulkDialog(ResizableDialog, Ui_MetadataBulkDialog): # convert the colon-separated pair strings back into a dict, # which is what set_identifiers wants dst_id_type = unicode(self.s_r_dst_ident.text()) - if dst_id_type: + if dst_id_type and dst_id_type != '*': v = ''.join(val) ids = mi.get(dest) ids[dst_id_type] = v val = ids else: - val = dict([(t.split(':')) for t in val]) + try: + val = dict([(t.split(':')) for t in val]) + except: + raise Exception(_('Invalid identifier string. It must be a ' + 'comma-separated list of pairs of ' + 'strings separated by a colon')) else: val = self.s_r_replace_mode_separator().join(val) if dest == 'title' and len(val) == 0: diff --git a/src/calibre/gui2/dialogs/metadata_bulk.ui b/src/calibre/gui2/dialogs/metadata_bulk.ui index 24a84eb1b4..6387626e58 100644 --- a/src/calibre/gui2/dialogs/metadata_bulk.ui +++ b/src/calibre/gui2/dialogs/metadata_bulk.ui @@ -504,7 +504,7 @@ from the value in the box - When doing a same format to same format conversion, + When doing a same format to same format conversion, for e.g., EPUB to EPUB, calibre saves the original EPUB as ORIGINAL_EPUB. This option tells calibre to restore the EPUB from ORIGINAL_EPUB. Useful if you did a bulk @@ -1006,7 +1006,10 @@ not multiple and the destination field is multiple - Choose which identifier type to operate upon + <p>Choose which identifier type to operate upon. If the + source field is something other than 'identifiers' you can enter + a * if you want to replace the entire set of identifiers with + the result of the search/replace.</p>