Skip to content

Commit

Permalink
fix page order in pdf and more by using natural sort instead of pytho…
Browse files Browse the repository at this point in the history
…n sort (#589)

* use natsorted

* Add fast
  • Loading branch information
axu2 authored Nov 9, 2023
1 parent 431862a commit 68da853
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kindlecomicconverter/comic2ebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from shutil import move, copytree, rmtree, copyfile
from multiprocessing import Pool
from uuid import uuid4
from natsort import natsorted
from slugify import slugify as slugify_ext
from PIL import Image
from subprocess import STDOUT, PIPE
Expand Down Expand Up @@ -762,7 +763,7 @@ def getPanelViewSize(deviceres, size):
def sanitizeTree(filetree):
chapterNames = {}
for root, dirs, files in os.walk(filetree, False):
for i, name in enumerate(sorted(files)):
for i, name in enumerate(natsorted(files)):
splitname = os.path.splitext(name)

# file needs kcc at front AND back to avoid renaming issues
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ python-slugify>=1.2.1
raven>=6.0.0
# PyQt5-tools
mozjpeg-lossless-optimization>=1.1.2
natsort[fast]>=8.4.0
distro

0 comments on commit 68da853

Please sign in to comment.