From 8a55b0dc79899ab9ad72d2731d087bb75db0dc97 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 6 May 2011 08:39:23 -0600 Subject: [PATCH 1/3] ... --- src/calibre/ebooks/pdf/input.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/pdf/input.py b/src/calibre/ebooks/pdf/input.py index 8de3f44d36..51f44ba502 100644 --- a/src/calibre/ebooks/pdf/input.py +++ b/src/calibre/ebooks/pdf/input.py @@ -32,10 +32,11 @@ class PDFInput(InputFormatPlugin): def convert_new(self, stream, accelerators): from calibre.ebooks.pdf.reflow import PDFDocument + from calibre.utils.cleantext import clean_ascii_chars if pdfreflow_err: raise RuntimeError('Failed to load pdfreflow: ' + pdfreflow_err) pdfreflow.reflow(stream.read(), 1, -1) - xml = open('index.xml', 'rb').read() + xml = clean_ascii_chars(open('index.xml', 'rb').read()) PDFDocument(xml, self.opts, self.log) return os.path.join(os.getcwd(), 'metadata.opf') From 6463d0e4239be2f48621497aed04166542bc969a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 6 May 2011 08:56:45 -0600 Subject: [PATCH 2/3] 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 From 945693da4b7582af8e3ffba7636fe1e8149e7ba5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 6 May 2011 09:03:31 -0600 Subject: [PATCH 3/3] Disable the Overdrive plugin by default as it is slow --- src/calibre/customize/ui.py | 3 +-- src/calibre/ebooks/metadata/sources/overdrive.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/calibre/customize/ui.py b/src/calibre/customize/ui.py index 3a2d638aab..70a6e104c3 100644 --- a/src/calibre/customize/ui.py +++ b/src/calibre/customize/ui.py @@ -92,8 +92,7 @@ def restore_plugin_state_to_default(plugin_or_name): config['enabled_plugins'] = ep default_disabled_plugins = set([ - 'Douban Books', 'Douban.com covers', 'Nicebooks', 'Nicebooks covers', - 'Kent District Library' + 'Overdrive', ]) def is_disabled(plugin): diff --git a/src/calibre/ebooks/metadata/sources/overdrive.py b/src/calibre/ebooks/metadata/sources/overdrive.py index ad570a8b28..4ee248579e 100755 --- a/src/calibre/ebooks/metadata/sources/overdrive.py +++ b/src/calibre/ebooks/metadata/sources/overdrive.py @@ -41,7 +41,7 @@ class OverDrive(Source): cached_cover_url_is_reliable = True options = ( - Option('get_full_metadata', 'bool', False, + Option('get_full_metadata', 'bool', True, _('Download all metadata (slow)'), _('Enable this option to gather all metadata available from Overdrive.')), )