benchen71 / epub-metadata-editor

Edit the metadata of EPUB files
194 stars 11 forks source link

Enhancements #48

Closed Kryz-El closed 4 years ago

Kryz-El commented 4 years ago

Hi. I use the heck out of your program. I even donated a few weeks ago (chriswellison@charter.net).

I think it might be useful if I could choose if the program continues to open after failing to read metadata. It's just blank when it can't.

I also think it would be useful if I could have a drop down list of favorite or recent file rename schemes.

Thanks!

benchen71 commented 4 years ago

I think what you are asking for is doable. I will start investigating adding a list of recent file rename schemes.

Do you have an example EPUB that fails to open? If you can attach one here, that will assist me.

My only concern is that the naive user won't know what to do if an EPUB has errors. I know that if an EPUB doesn't open, I look at the OPF file, try and locate whatever is causing EPubMetadataEditor to fail, manually fix it, and then try again. It is certainly possible to do this inside EPubMetadataEditor using the Advanced Tasks panel. But tracking down an error in XML code is not for everyone. So what do you envision wanting to do after opening an EPUB that has errors in the OPF file?

benchen71 commented 4 years ago

You'll be pleased to know that when I release the next version (1.7.4) it will have an initial implementation of a history of rename schemes, containing the last 6 schemes. I am not completely happy with it, however, since I can't find a way to deselect the text when you click on one of the entries in the dropdown list.

benchen71 commented 4 years ago

Actually, now that I look at my code, it should be able to handle opening an EPUB file with errors in the OPF file. If it can't find an OPF then it will fail to open. But there is no way the program could continue to open without an OPF file.

So I will definitely need an example (problematic) EPUB, so I can see what the issue is and see if I can work out how to proceed.

Kryz-El commented 4 years ago

malformed.zip sigil repaired.zip

Today was a good (bad) day. Only 2 that wouldn't open. For the ones that won't open, I open them in Sigil and just hit save. They will always open in EME after that. I have included 2 zips. Before & after in case you would like to compare.

When a book fails to open, you get the malformed dialog and an okay button. The okay button goes ahead and opens the program with everything grayed out. That may be useful to some but I think it would be convenient to have a Cancel button also that aborts opening the program.

I am excited about the rename scheme history. I only use 3 schemes on a regular basis so 6 will be great.

I'm also very appreciative of you taking an interest in my ideas. Thanks!

benchen71 commented 4 years ago

I found the problem. It was happening in the ZIP library I was using. I've implemented a work-around which seems to deal with the problem. It certainly opened the two EPUBs you attached. (I opened them in 7-zip and there was a warning error: There are some data after the end of the payload data. And my work-around involves just ignoring it if there is data beyond what should be the final comment of the zip file.)

All that to say that 1.7.4 (which I have now released) should deal with your issues. If you find a problem, though, let me know!