Add a separate setting for saving backups of files when polishing. That way you can have calibre save backups while converting EPUB->EPUB and not while polishing, if you so desire.

This commit is contained in:
Kovid Goyal 2013-02-15 16:53:19 +05:30
parent b0a56df363
commit 68007f2c7f
2 changed files with 5 additions and 2 deletions

View File

@ -464,12 +464,15 @@ server_listen_on = '0.0.0.0'
# on at your own risk! # on at your own risk!
unified_title_toolbar_on_osx = False unified_title_toolbar_on_osx = False
#: Save original file when converting from same format to same format #: Save original file when converting/polishing from same format to same format
# When calibre does a conversion from the same format to the same format, for # When calibre does a conversion from the same format to the same format, for
# example, from EPUB to EPUB, the original file is saved, so that in case the # example, from EPUB to EPUB, the original file is saved, so that in case the
# conversion is poor, you can tweak the settings and run it again. By setting # conversion is poor, you can tweak the settings and run it again. By setting
# this to False you can prevent calibre from saving the original file. # this to False you can prevent calibre from saving the original file.
# Similarly, by setting save_original_format_when_polishing to False you can
# prevent calibre from saving the original file when polishing.
save_original_format = True save_original_format = True
save_original_format_when_polishing = True
#: Number of recently viewed books to show #: Number of recently viewed books to show
# Right-clicking the View button shows a list of recently viewed books. Control # Right-clicking the View button shows a list of recently viewed books. Control

View File

@ -401,7 +401,7 @@ class PolishAction(InterfaceAction):
fmts = set() fmts = set()
for path in files: for path in files:
fmt = path.rpartition('.')[-1].upper() fmt = path.rpartition('.')[-1].upper()
if tweaks['save_original_format']: if tweaks['save_original_format_when_polishing']:
fmts.add(fmt) fmts.add(fmt)
db.save_original_format(book_id, fmt, notify=False) db.save_original_format(book_id, fmt, notify=False)
with open(path, 'rb') as f: with open(path, 'rb') as f: