mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
More miscellaneous fixes
This commit is contained in:
parent
19e7ed0cb7
commit
e80fcc13fc
@ -941,7 +941,10 @@ class Manifest(object):
|
|||||||
href = urlunparse(purl)
|
href = urlunparse(purl)
|
||||||
path, frag = urldefrag(href)
|
path, frag = urldefrag(href)
|
||||||
if not path:
|
if not path:
|
||||||
return '#'.join((self.href, frag))
|
if frag:
|
||||||
|
return '#'.join((self.href, frag))
|
||||||
|
else:
|
||||||
|
return self.href
|
||||||
if '/' not in self.href:
|
if '/' not in self.href:
|
||||||
return href
|
return href
|
||||||
dirname = os.path.dirname(self.href)
|
dirname = os.path.dirname(self.href)
|
||||||
|
@ -102,6 +102,7 @@ class DetectStructure(object):
|
|||||||
play_order=self.oeb.toc.next_play_order())
|
play_order=self.oeb.toc.next_play_order())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def elem_to_link(self, item, elem, counter):
|
def elem_to_link(self, item, elem, counter):
|
||||||
text = u' '.join([t.strip() for t in elem.xpath('descendant::text()')])
|
text = u' '.join([t.strip() for t in elem.xpath('descendant::text()')])
|
||||||
text = text[:100].strip()
|
text = text[:100].strip()
|
||||||
|
@ -159,9 +159,12 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
|
|||||||
row = self.formats.currentRow()
|
row = self.formats.currentRow()
|
||||||
fmt = self.formats.item(row)
|
fmt = self.formats.item(row)
|
||||||
if fmt is None:
|
if fmt is None:
|
||||||
error_dialog(self, _('No format selected'),
|
if self.formats.count() == 1:
|
||||||
|
fmt = self.formats.item(0)
|
||||||
|
if fmt is None:
|
||||||
|
error_dialog(self, _('No format selected'),
|
||||||
_('No format selected')).exec_()
|
_('No format selected')).exec_()
|
||||||
return
|
return
|
||||||
ext = fmt.ext.lower()
|
ext = fmt.ext.lower()
|
||||||
if fmt.path is None:
|
if fmt.path is None:
|
||||||
stream = self.db.format(self.row, ext, as_file=True)
|
stream = self.db.format(self.row, ext, as_file=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user