valos/Komikku
9
102
Fork
You've already forked Komikku
29

[Servers] Sort names with nat sort in local server #907

Merged
valos merged 1 commit from nivkner/Komikku:natsort_local into main 2026年07月06日 00:49:02 +02:00
Contributor
Copy link

since titles are sorted with natsort when listing chapters, it seems more intuitive to handle file names the same way.
this way the "source order" of chapters of a local manga (which is the default) also uses natsort,
so the expected order of files is shown when the names are enumerated, e.g.

Example/ch1.cbz
Example/ch2.cbz
...
Example/ch10.cbz

natsort is designed as a drop-in replacement to sorted, so there should be no issue in replacing sorted with it:

>>> natsort.natsorted([(1, "num 2"),(3, "num 0") , (1, "num 10")])
[(1, 'num 2'), (1, 'num 10'), (3, 'num 0')]
>>> sorted([(1, "num 2"),(3, "num 0") , (1, "num 10")])
[(1, 'num 10'), (1, 'num 2'), (3, 'num 0')]
since titles are sorted with `natsort` when listing chapters, it seems more intuitive to handle file names the same way. this way the "source order" of chapters of a local manga (which is the default) also uses `natsort`, so the expected order of files is shown when the names are enumerated, e.g. ``` Example/ch1.cbz Example/ch2.cbz ... Example/ch10.cbz ``` `natsort` is designed as a drop-in replacement to `sorted`, so there should be no issue in replacing `sorted` with it: ``` >>> natsort.natsorted([(1, "num 2"),(3, "num 0") , (1, "num 10")]) [(1, 'num 2'), (1, 'num 10'), (3, 'num 0')] >>> sorted([(1, "num 2"),(3, "num 0") , (1, "num 10")]) [(1, 'num 10'), (1, 'num 2'), (3, 'num 0')] ```
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
valos/Komikku!907
Reference in a new issue
valos/Komikku
No description provided.
Delete branch "nivkner/Komikku:natsort_local"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?