View Single Post
Old 05-03-2019, 07:03 AM   #1220
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,254
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
I'm not sure whether this helps or hinders ...

Good news: calibre has its own utility (rename_files in calibre.ebooks.oeb.polish.replace) for changing filenames inside an epub. This is the help info:
Code:
Rename files in the container, automatically updating all links to them.
:param file_map: A mapping of old canonical name to new canonical name, for
    example: :code:`{'text/chapter1.html': 'chapter1.html'}`.
Bad news: All calibre's own epub manipulation relies on using its standard EpubContainer class. Unfortunately kiwidude's Modify Epub plugin pre-dates EpubContainer so it has its own earlier version of a Container class.

I don't know how much work would be involved in getting the ME Container to use calibre.ebooks.oeb.polish.replace.rename_files.

Ideally ME needs a complete overhaul to use pure calibre container functionality for everything ... but that's not a trivial exercise.
jackie_w is offline   Reply With Quote