From 7e63bd6da31265c3b165d24fb83b87b422a78d26 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 10 May 2012 09:16:43 +0530 Subject: [PATCH] Edit metadata dialog: When runnning download metadata do not isert duplicate tags into the list of tags --- src/calibre/gui2/metadata/single.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/metadata/single.py b/src/calibre/gui2/metadata/single.py index 2a61b9dcf1..367068b7f2 100644 --- a/src/calibre/gui2/metadata/single.py +++ b/src/calibre/gui2/metadata/single.py @@ -357,7 +357,9 @@ class MetadataSingleDialogBase(ResizableDialog): old_tags = self.tags.current_val tags = mi.tags if mi.tags else [] if old_tags and merge_tags: - tags += old_tags + ltags, lotags = {t.lower() for t in tags}, {t.lower() for t in + old_tags} + tags = [t for t in tags if t.lower() in ltags-lotags] + old_tags self.tags.current_val = tags if not mi.is_null('identifiers'): current = self.identifiers.current_val