Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix page order and bookmarks by renaming numerically #507

Merged
merged 14 commits into from
Aug 7, 2023

Conversation

axu2
Copy link
Collaborator

@axu2 axu2 commented May 5, 2023

Fix Page Order Issue:

Fix various bookmark issues due to kcc-b logic:

(I suspect larger files made by comicrack are more likely to have bookmarks that cause issues).

Don't rename files with slugify and fix the bookmark drift issue.

Hasn't caused any issues in the files I've tested however, with flat files and subdirectories.

@cyberbad @4AM-Campfire @VictorGamerLOL @Scotsguy @tao-cumplido @ahihh @noahastor @Jhoelious @crevopunch @augustebaum @origaniels

#46 seems related

@darodi darodi added Kobo Kobo device help wanted Extra attention is needed labels May 13, 2023
@darodi darodi added this to the 5.6.3 milestone May 13, 2023
@axu2 axu2 changed the title Fix page order issue Fix page order issue by disabling renaming May 22, 2023
@axu2
Copy link
Collaborator Author

axu2 commented Jun 25, 2023

Here's a file I used for testing has special characters, whitespace, japanese:
crop jpg.zip

Make sure generated file confirms to EPUB 3.3 https://github.com/w3c/epubcheck

@axu2
Copy link
Collaborator Author

axu2 commented Jun 26, 2023

Main issue is with files with a # character, which is really low in the ascii sort order. It's above whitespace but below underscore _ and dash - which slugify transforms between.

@axu2
Copy link
Collaborator Author

axu2 commented Jun 26, 2023

My conclusion: slugify was needed to conform to EPUB standards. But will re-order files.

Only solution is to completely re-name files like mangle. But realistically, no one cares what the filenames are after conversion.

@axu2
Copy link
Collaborator Author

axu2 commented Jun 26, 2023

Decided to rename pages numerically 0000.jpg 0001.jpg etc. We actually already do this for KOBO.

@axu2 axu2 changed the title Fix page order issue by disabling renaming Fix page order issue by renaming numerically Jun 26, 2023
@axu2
Copy link
Collaborator Author

axu2 commented Jun 26, 2023

Can delete this:

            while os.path.exists(os.path.join(root, slugified + splitname[1])) and splitname[0].upper()\
                    != slugified.upper():
                slugified += "A"

since we aren't preserving original names at all anymore. We might have issues with files that look like 0000-kcc.jpg originally, but that's an expected error, if someone is re-processing KCC files somehow by mistake and the UI will warn issues might happen.

Added KCC to start and end of file.

@axu2 axu2 marked this pull request as ready for review June 26, 2023 17:49
@darodi
Copy link
Collaborator

darodi commented Jun 27, 2023

@axu2
is kindlecomicconverter.comic2ebook.sanitizeTreeKobo still needed if all files are renamed with a counter?

@axu2
Copy link
Collaborator Author

axu2 commented Jun 27, 2023

Oh that's right, we can remove the Kobo one too since they are doing the same thing now.

@axu2 axu2 changed the title Fix page order issue by renaming numerically Fix page order and bookmarks by renaming numerically Jun 29, 2023
@axu2
Copy link
Collaborator Author

axu2 commented Jul 20, 2023

Thank you to @vinhtq115 for extensive testing in #558

Looks like this now:

image

@darodi darodi modified the milestones: 5.6.3, 5.6.4 Aug 6, 2023
@darodi darodi merged commit 6836c20 into ciromattia:master Aug 7, 2023
@axu2 axu2 deleted the slugify branch August 7, 2023 18:25
@darodi darodi modified the milestones: 5.6.4, 5.6.3 Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment