mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #966 (Problem converting LIT to LRF)
This commit is contained in:
commit
ec7ac06a0d
@ -1,10 +1,11 @@
|
|||||||
import cStringIO
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
import uuid
|
|
||||||
'''Read/Write metadata from Open Packaging Format (.opf) files.'''
|
'''Read/Write metadata from Open Packaging Format (.opf) files.'''
|
||||||
|
|
||||||
import sys, re, os, glob
|
import sys, re, os, glob
|
||||||
|
import cStringIO
|
||||||
|
import uuid
|
||||||
|
from urllib import unquote, quote
|
||||||
|
|
||||||
from calibre import __appname__
|
from calibre import __appname__
|
||||||
from calibre.ebooks.metadata import MetaInformation
|
from calibre.ebooks.metadata import MetaInformation
|
||||||
@ -25,7 +26,10 @@ class ManifestItem(Resource):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def from_opf_manifest_item(item, basedir):
|
def from_opf_manifest_item(item, basedir):
|
||||||
if item.has_key('href'):
|
if item.has_key('href'):
|
||||||
res = ManifestItem(item['href'], basedir=basedir, is_path=False)
|
href = item['href']
|
||||||
|
if unquote(href) == href:
|
||||||
|
href = quote(href)
|
||||||
|
res = ManifestItem(href, basedir=basedir, is_path=False)
|
||||||
mt = item.get('media-type', '').strip()
|
mt = item.get('media-type', '').strip()
|
||||||
if mt:
|
if mt:
|
||||||
res.mime_type = mt
|
res.mime_type = mt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user