mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
88f668c407
@ -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):
|
||||
|
@ -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.')),
|
||||
)
|
||||
|
@ -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')
|
||||
|
||||
|
@ -295,9 +295,8 @@ class AuthorSortEdit(EnLineEdit):
|
||||
return property(fget=fget, fset=fset)
|
||||
|
||||
def update_state_and_val(self):
|
||||
au = unicode(self.authors_edit.text())
|
||||
# Handle case change if the authors box changed
|
||||
aus = authors_to_sort_string(string_to_authors(au))
|
||||
aus = authors_to_sort_string(self.authors_edit.current_val)
|
||||
if strcmp(aus, self.current_val) == 0:
|
||||
self.current_val = aus
|
||||
self.update_state()
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user