Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old Today, 12:12 PM   #1
Kayadelenium
Addict
Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.
 
Kayadelenium's Avatar
 
Posts: 297
Karma: 364036
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
[Editor Plugin] epubsana

epubsana for calibre

This plugin will repair a book in your calibre library with epubsana, my EPUB repair tool. epubsana fixes the defects epubveri reports where there is exactly one correct repair that keeps the content as it is, and leaves everything else alone.

It is not out yet. I am opening its thread before I write it, because it is the first of my calibre plugins that changes a book instead of reporting on it, and I would rather hear first how you want that done. The next post asks the question I do not want to settle alone.

What it will do
  • Select a book and run epubsana from its toolbar button. It works on one book at a time.
  • A window lists every repair epubsana proposes for that book, and selecting a line shows each file the fix touches and what changes there. The safe fixes are ticked. The ones that need your judgement are not, so you can look at them first. For a text-encoding repair, for example, the preview quotes the text as it will read afterwards, so you can see whether it reads right.
  • Only the fixes you approved are applied, and epubsana checks the book again afterwards. A fix that made the book worse is undone, and the report says so.

Why it will be safe to point at your library
  • epubsana never writes to the file it reads. The repair runs on a copy in a temporary folder.
  • Nothing reaches your library until you have seen the proposed fixes and approved them. If the run fails, or no fix was applied, the library is left as it was.
  • The book's file as it was before the repair is kept, and can be put back. How and where is the question in the next post.

Nothing is bundled. Like my other calibre plugins, it will contain no binary. On first use it downloads epubsana for your platform from epubsana's own GitHub releases and verifies it against that release's published SHA256SUMS.txt before running it.

Until it is out, the same repairs are available from the command line, in the browser and in Sigil. The epubsana thread has the links.

Where to report what. Anything about this plugin belongs in this thread or at https://github.com/veripublica/calibre-plugins/issues. A question about a repair itself, what epubsana does to a book, belongs in the epubsana thread, https://www.mobileread.com/forums/sh...d.php?t=374799.

Links
Kayadelenium is online now   Reply With Quote
Old Today, 12:13 PM   #2
Kayadelenium
Addict
Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.
 
Kayadelenium's Avatar
 
Posts: 297
Karma: 364036
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
Before I write the plugin, I would like your view on one thing: where the repaired book goes. I see two ways.

A. The same book record. The repaired file becomes the book's EPUB, and the file as it was before is kept in the same record as ORIGINAL_EPUB, the way calibre's own Polish and Convert keep theirs. Both files stay in your library, side by side in the Book details panel, and calibre's own Restore command there brings the old one back. Metadata, custom columns, annotations and whatever a device plugin stores stay with the book, and sending it to your reader again replaces the copy there. If the book already has an ORIGINAL_EPUB from an earlier conversion or polish, the plugin leaves it alone and keeps its own copy of the pre-repair file with the book, with a menu entry to put it back.

B. A new book record. The repaired file is added as a separate book with the same metadata and cover, and the original record is not touched at all. The price is two entries for the same book, in the library and on the reader, and the reading position, annotations, collections and custom columns stay with the old one.

I lean towards A. In the epubsana thread, fogice asked how to put a repaired book back into calibre while keeping the reading position Kobo Utilities records, and the answer was to replace the format, not the book. But you are the ones who will live with it, so:

1. Would you use A or B? Should it be a setting?
2. If you see a repair on your reader and do not like it, how would you want to undo it?
3. Is there anything else you would expect from a plugin that changes books in your library?
Kayadelenium is online now   Reply With Quote
Advert
Old Today, 02:48 PM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 85,778
Karma: 154365285
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Do it like the Modify ePub plugin does it. Modify ePub creates an ORIGINAL_EPUB. But what it does differently to the rest of calibre, is that if you run Modify ePub multiple times, it never touches the ORIGINAL_EPUB. So you can run Modify ePub on your source ePub as much as you want.
JSWolf is offline   Reply With Quote
Reply

Tags
autofix, epub, epubsana, repair, veripublica


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] epubsana - Repair the book with epubsana. Kayadelenium Plugins 1 Today 03:50 PM
epubsana — automatic repair for what epubcheck reports (not an editor) Kayadelenium ePub 70 Today 09:47 AM
[Editor Plugin] Editor Chains capink Plugins 138 11-10-2026 06:54 PM
[Editor Plugin] Bulk Image Resizer Plugin eliteart Plugins 11 10-27-2024 04:47 PM
[Editor Plugin] - Enabling 'Customize plugin' dialog directly from the Editor thiago.eec Development 7 01-09-2019 09:05 PM


All times are GMT -4. The time now is 04:42 PM.


MobileRead.com is a privately owned, operated and funded community.