diff --git a/src/calibre/gui2/dialogs/user_profiles.py b/src/calibre/gui2/dialogs/user_profiles.py index 5cae63c6d7..a06191e48c 100644 --- a/src/calibre/gui2/dialogs/user_profiles.py +++ b/src/calibre/gui2/dialogs/user_profiles.py @@ -84,6 +84,7 @@ class UserProfiles(QDialog, Ui_Dialog): self.populate_options(recipe) self.stacks.setCurrentIndex(0) self.toggle_mode_button.setText(_('Switch to Advanced mode')) + self.source_code.setPlainText('') else: self.source_code.setPlainText(src) self.highlighter = PythonHighlighter(self.source_code.document()) diff --git a/src/calibre/library/cli.py b/src/calibre/library/cli.py index 451e91acc0..edda1c8502 100644 --- a/src/calibre/library/cli.py +++ b/src/calibre/library/cli.py @@ -337,6 +337,9 @@ def do_set_metadata(db, id, stream): mi = OPFReader(stream) db.set_metadata(id, mi) do_show_metadata(db, id, False) + if SingleApplication is not None: + sa = SingleApplication('calibre GUI') + sa.send_message('refreshdb:') def command_set_metadata(args, dbpath): parser = get_parser(_( diff --git a/src/calibre/library/database.py b/src/calibre/library/database.py index c357239fa5..dc4f4e31de 100644 --- a/src/calibre/library/database.py +++ b/src/calibre/library/database.py @@ -1422,7 +1422,7 @@ ALTER TABLE books ADD COLUMN isbn TEXT DEFAULT "" COLLATE NOCASE; mi = OPFCreator(base, self.get_metadata(idx, index_is_id=index_is_id)) cover = self.cover(idx, index_is_id=index_is_id) if cover is not None: - cname = name + '.jpg' + cname = sanitize_file_name(name) + '.jpg' cpath = os.path.join(base, cname) open(cpath, 'wb').write(cover) mi.cover = cname