From 6463d0e4239be2f48621497aed04166542bc969a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 6 May 2011 08:56:45 -0600 Subject: [PATCH] When setting metadata from a download or a format in the edit metadata single dialog, update title sort and author sort as well --- src/calibre/gui2/metadata/single.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/metadata/single.py b/src/calibre/gui2/metadata/single.py index 69c7677a2e..f0a05d171f 100644 --- a/src/calibre/gui2/metadata/single.py +++ b/src/calibre/gui2/metadata/single.py @@ -292,13 +292,17 @@ class MetadataSingleDialogBase(ResizableDialog): show=True) return - def update_from_mi(self, mi): + def update_from_mi(self, mi, update_sorts=True): if not mi.is_null('title'): self.title.current_val = mi.title + if update_sorts: + self.title_sort.auto_generate() if not mi.is_null('authors'): self.authors.current_val = mi.authors if not mi.is_null('author_sort'): self.author_sort.current_val = mi.author_sort + elif update_sorts: + self.author_sort.auto_generate() if not mi.is_null('rating'): try: self.rating.current_val = mi.rating