mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
commit
f79a70c50a
@ -164,7 +164,7 @@ class APNXBuilder(object):
|
|||||||
if c == '/':
|
if c == '/':
|
||||||
closing = True
|
closing = True
|
||||||
continue
|
continue
|
||||||
elif c in ('d', 'p'):
|
elif c == 'p':
|
||||||
if closing:
|
if closing:
|
||||||
in_p = False
|
in_p = False
|
||||||
else:
|
else:
|
||||||
|
@ -70,7 +70,7 @@ def set_metadata(stream, mi):
|
|||||||
# Update the metadata.
|
# Update the metadata.
|
||||||
old_mi = opf.to_book_metadata()
|
old_mi = opf.to_book_metadata()
|
||||||
old_mi.smart_update(mi)
|
old_mi.smart_update(mi)
|
||||||
opf.smart_update(metadata_to_opf(old_mi))
|
opf.smart_update(metadata_to_opf(old_mi), replace_metadata=True)
|
||||||
newopf = StringIO(opf.render())
|
newopf = StringIO(opf.render())
|
||||||
safe_replace(stream, opf_path, newopf, extra_replacements=replacements, add_missing=True)
|
safe_replace(stream, opf_path, newopf, extra_replacements=replacements, add_missing=True)
|
||||||
|
|
||||||
|
@ -439,10 +439,16 @@ class BooksView(QTableView): # {{{
|
|||||||
|
|
||||||
if tweaks['sort_columns_at_startup'] is not None:
|
if tweaks['sort_columns_at_startup'] is not None:
|
||||||
sh = []
|
sh = []
|
||||||
for c,d in tweaks['sort_columns_at_startup']:
|
try:
|
||||||
if not isinstance(d, bool):
|
for c,d in tweaks['sort_columns_at_startup']:
|
||||||
d = True if d == 0 else False
|
if not isinstance(d, bool):
|
||||||
sh.append((c, d))
|
d = True if d == 0 else False
|
||||||
|
sh.append((c, d))
|
||||||
|
except:
|
||||||
|
# Ignore invalid tweak values as users seem to often get them
|
||||||
|
# wrong
|
||||||
|
import traceback
|
||||||
|
traceback.print_exc()
|
||||||
old_state['sort_history'] = sh
|
old_state['sort_history'] = sh
|
||||||
|
|
||||||
self.apply_state(old_state)
|
self.apply_state(old_state)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user