JimmXinu / EpubMerge

EpubMerge Calibre Plugin
GNU General Public License v3.0
109 stars 16 forks source link

[Feature request] Add a "-%n" to the filename of duplicated medias if the epub has them across all folders #22

Open Palloxin opened 17 hours ago

Palloxin commented 17 hours ago

Lets say image

In this epub there are 20 or so files with the same exact name, but in different folders. This might create some conflict or import problems on other epub readers, maybe also other programs.

Would be possible to add a -%n to the duplicated files name? For example 1/OEBPS/Images/Cover.jpg => Cover-0.jpg 10/OEBPS/Images/Cover.jpg => Cover-9.jpg

Other details

image

here the file path is not so specific, so some programs might have problems since the merged epubs had the same file path.

Of course also the src links shuld be changed too, accordingly.

JimmXinu commented 16 hours ago

This absolutely does cause issues with some programs that don't pay attention to file paths. Not just with images, either. We saw it for years in Sigil, for example--now fixed as far as I know.

It came up again recently in #20 for stylesheets where I said:

EpubMerge doesn't actually parse or change the contents of the (x)html or style sheet files from merged books--it just puts them each in a subdirectory inside the zip file.

I'm reluctant to add that much additional processing to address what is essentially a bug in another program...

And since you're asking about a 'might' and not a specific 'program XYZ doesn't handle this correctly', I'm honestly even more reluctant.

As a work around, Calibre's Convert and Edit book tools both have options that can rewrite the epub to have all unique file names; albeit with the downside of losing EpubMerge's 'UnMerge' capability unless you save the pre-convert/edit epub.

Palloxin commented 16 hours ago

Understood, would be possible to merge that calibre functionality into the plugin? idk (ignornatly), calling the feature and trasporting it in the plugin UX interface.

Since these problems are so frequent.. even with the mighty Moonreader like in that issue.

JimmXinu commented 11 hours ago

I wouldn't say it's frequent. It's come up like 3-4 times I can remember in 12 years. And I remember because it is so baffling to me this is an issue.

Zip files containing dir paths goes back to pkzip 30+ years ago; and html links allowing for relative paths about the same. Which is the case in your screenshot above--there's no ambiguity unless the program is ignoring dir paths.

So I'll ask directly, what programs are you having problems with?

Palloxin commented 5 hours ago

Lithium ReadEra LNReader, import feature (the nearest tachi-like for novels app avaiable on the internet)

i didnt dig deeply for other apps