mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit Book: Fix Check Book reporting a spurious mime/type mismatch error after replacing a file with a file having a different mime type. Fixes #1653977 [Editor:Problem with Check Book after using Replace image with file](https://bugs.launchpad.net/calibre/+bug/1653977)
This commit is contained in:
parent
257ef9ad9b
commit
c606844677
@ -219,6 +219,7 @@ def replace_file(container, name, path, basename, force_mt=None):
|
|||||||
nname = b + ('_%d.%s' % (count, e))
|
nname = b + ('_%d.%s' % (count, e))
|
||||||
rename_files(container, {name:nname})
|
rename_files(container, {name:nname})
|
||||||
mt = force_mt or container.guess_type(nname)
|
mt = force_mt or container.guess_type(nname)
|
||||||
|
container.mime_map[nname] = mt
|
||||||
for itemid, q in container.manifest_id_map.iteritems():
|
for itemid, q in container.manifest_id_map.iteritems():
|
||||||
if q == nname:
|
if q == nname:
|
||||||
for item in container.opf_xpath('//opf:manifest/opf:item[@href and @id="%s"]' % itemid):
|
for item in container.opf_xpath('//opf:manifest/opf:item[@href and @id="%s"]' % itemid):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user