1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 09:46:25 +00:00

fix page order in pdf and more by using natural sort instead of python sort (#589)

* use natsorted

* Add fast
This commit is contained in:
Alex Xu
2023-11-09 15:00:44 -08:00
committed by GitHub
parent 431862a2e9
commit 68da853e42
2 changed files with 3 additions and 1 deletions

View File

@@ -32,6 +32,7 @@ from tempfile import mkdtemp, gettempdir, TemporaryFile
from shutil import move, copytree, rmtree, copyfile from shutil import move, copytree, rmtree, copyfile
from multiprocessing import Pool from multiprocessing import Pool
from uuid import uuid4 from uuid import uuid4
from natsort import natsorted
from slugify import slugify as slugify_ext from slugify import slugify as slugify_ext
from PIL import Image from PIL import Image
from subprocess import STDOUT, PIPE from subprocess import STDOUT, PIPE
@@ -762,7 +763,7 @@ def getPanelViewSize(deviceres, size):
def sanitizeTree(filetree): def sanitizeTree(filetree):
chapterNames = {} chapterNames = {}
for root, dirs, files in os.walk(filetree, False): 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) splitname = os.path.splitext(name)
# file needs kcc at front AND back to avoid renaming issues # file needs kcc at front AND back to avoid renaming issues

View File

@@ -5,4 +5,5 @@ python-slugify>=1.2.1
raven>=6.0.0 raven>=6.0.0
# PyQt5-tools # PyQt5-tools
mozjpeg-lossless-optimization>=1.1.2 mozjpeg-lossless-optimization>=1.1.2
natsort[fast]>=8.4.0
distro distro