From c3aa30064bac434a4cc3a746e1dd74eced7206e9 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Thu, 2 Sep 2010 20:34:45 +0100 Subject: [PATCH] Add tweak to respect add_tags_to_new_books when copying between libraries. --- resources/default_tweaks.py | 5 +++++ src/calibre/gui2/actions/copy_to_library.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py index 8d853deaa9..afbc6e7334 100644 --- a/resources/default_tweaks.py +++ b/resources/default_tweaks.py @@ -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 + diff --git a/src/calibre/gui2/actions/copy_to_library.py b/src/calibre/gui2/actions/copy_to_library.py index ff2bcd47c8..7127c91e8c 100644 --- a/src/calibre/gui2/actions/copy_to_library.py +++ b/src/calibre/gui2/actions/copy_to_library.py @@ -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)