savrus / uguu

Automatically exported from code.google.com/p/uguu
Other
3 stars 1 forks source link

Sorting file names #65

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Ordering files by name in low-level scanners not enough human-friendly.
Many files with nearly the same name could be ordered unnaturally. Here are
some examples:
{{
file0
file1
file11
file12
...
file19
file2
file21
}}

{{
[Ecliptic-BSS] Durarara!! - 07 [9FA14427].mkv
[Ecliptic-BSS] Durarara!! - 12 [191E1603].mkv
[Ecliptic-BSS]_Durarara!!_-_08_[ED6EE24B].mkv
[Ecliptic-BSS]_Durarara!!_-_09_[E3D6E06D].mkv
[Ecliptic-BSS]_Durarara!!_-_10_[ADE707DB].mkv
[Ecliptic-BSS]_Durarara!!_-_13_[A50B20CF].mkv
[Ecliptic-BSS]_Durarara!!_-_14_[2CA7A937].mkv
[Ecliptic-BSS]_Durarara!!_-_15_[612994B7].mkv
}}

Compare routine which behave good on the first example could be found at
http://sourcefrog.net/projects/natsort/. Also, there is unix command "sort
-n", which behave good on the second example. But neither natsort, nor
"sort -n" does work fine on both examples.

Original issue reported on code.google.com by radist...@gmail.com on 28 May 2010 at 11:37

GoogleCodeExporter commented 9 years ago
and don't forget to compare string case-independently

Original comment by ruslan.savchenko on 28 May 2010 at 12:55