fix(api): Use fixed-layout epub format in Kobo sync when necessary (Booklore PR Port)#16
fix(api): Use fixed-layout epub format in Kobo sync when necessary (Booklore PR Port)#16N00byKing wants to merge 7 commits intogrimmory-tools:developfrom
Conversation
|
Does this also fix it for when CBX comics get converted to EPUBs during the Kobo sync? Or just EPUB to EPUB? Since this was an issue I was annoyed by when I added the CBX to EPUB conversion for kobo sync, as I didn't know this fixed layout was an option when I was working on that. |
|
Atm no. I dont know if all cbx files should be treated as fixed layout since I never used any, and they dont have a similar metadata property that I could check for. If this should apply to all cbx files its a pretty easy change though. |
|
Here's the change needed to make it apply to cbx files as well: N00byKing@d2a2106 If you try it out and it works I'll put it in the PR as well. |
|
I'll test it out and see how it reacts, but effectively Kobo sync doesn't support CBX files so I added functionality that creates new EPUB files using the images extracted from a CBX file. A CBX file is just a ZIP/RAR/7zip file with a bunch of images inside, so they're effectively always comics or manga. So when a CBX file is picked up in the kobo sync, it triggers the below to convert it to an EPUB. That basically just builds an EPUB out of the template files present below, with each image (pulled from the CBX file) being put on it's own page inside the EPUB. If it's easier, I'm happy to wait until this is merged in (As it is without the CBX stuff) and things are stable, and then loop back to look at it. |
Could you not just change this one line to |
|
For the fixed layout stuff there's a new entry in the database, so imo it makes more sense to populate it just the same as for the epubs for consistency. |
89113d4 to
37ca101
Compare


📝 Description
Unfortunately, I can't get the old PR description back, which sucks.
Also no linked issue because its gone :/
This PR fixes the format specifier in the Kobo Sync endpoint for fixed-layout epubs.
Previously, fixed layout epubs (comics/mangas/etc.) would use the normal book viewer, which does not do double page spreads on landscape, and always shows some header/footer margin.
With this PR, the ereader uses the actual comic reader which doesnt have these issues.
It has already gone through two rounds of review, first one moving the check from sync-time to book-import-time,
then some minor cleanup throughout.
I've made sure that the commit history is preserved when getting this PR ready, so you'll be able to browse the changes individually.
Linked Issue: Fixes #
🏷️ Type of Change
🔧 Changes
The
book_filedatabase now has an additional property specifying whether or not a book is a fixed-layout epub.This property is then read during Kobo Sync attempts to correctly populate the ebook format in the response.
Also deduplicates a lot of code that opens and reads the epub OPF file.
🧪 Testing (MANDATORY)
Manual testing steps you performed:
Regression testing:
Edge cases covered:
Test output:
Backend test output (
./gradlew test)Frontend test output (
ng test)📸 Screen Recording / Screenshots (MANDATORY)
Lost to time.
I can re-do the screenshots once I'm home, but its just some pictures of my ereader showing the epubs in fullscreen.
✅ Pre-Submission Checklist
develop(merge conflicts resolved)🤖 AI-Assisted Contributions
No AI was used for this PR
💬 Additional Context (optional)
Though it was working fine on the booklore code, I still need to do an end-to-end test on the forked repo.
It passes all tests atm, but probably best not to merge until I can try it on my actual device tonight (Like, 8ish hours from now)
Feel free to try it out yourself though.
Thanks for forking booklore, I really did not feel like migrating my book collection again