Add a tweak that controls whether new book tags are applied when copying a book to another library

This commit is contained in:
Kovid Goyal 2010-09-02 13:42:26 -06:00
commit adcf9e2f16
2 changed files with 7 additions and 2 deletions

View File

@ -105,3 +105,8 @@ auto_connect_to_folder = ''
# case. 'MySearch' and 'mysearch' are the same term.
grouped_search_terms = {}
# Set this to True (not 'True') to ensure that tags in 'Tags to add when adding
# a book' are added when copying books to another library
add_new_book_tags_when_importing_books = False

View File

@ -14,7 +14,7 @@ from PyQt4.Qt import QMenu, QToolButton
from calibre.gui2.actions import InterfaceAction
from calibre.gui2 import error_dialog, Dispatcher
from calibre.gui2.dialogs.progress import ProgressDialog
from calibre.utils.config import prefs
from calibre.utils.config import prefs, tweaks
class Worker(Thread):
@ -67,7 +67,7 @@ class Worker(Thread):
self.add_formats(identical_book, paths, newdb, replace=False)
if not added:
newdb.import_book(mi, paths, notify=False, import_hooks=False,
apply_import_tags=False)
apply_import_tags=tweaks['add_new_book_tags_when_importing_books'])
co = self.db.conversion_options(x, 'PIPE')
if co is not None:
newdb.set_conversion_options(x, 'PIPE', co)