it’s so confusing that the order changes when adding IDENTICAL strings to BOTH filenames. Is this really how it’s supposed to be?

  • folekaule@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    13 days ago

    Yes. The periods are just part of the name like any other letter, so 5 is compared to m, and numbers sort before letters. You can add something like ‘.0’ to make it sort more naturally. Look up an ASCII table to get a feeling for how strings are sorted.

  • Lysergid@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    13 days ago

    What you expecting called natural sorting. Mac employed natural sorting back in 90s. What you get is legitimate Alphabetical sorting which used by Linux and Windows. Natural sorting parses tokens in the string and compares them. Alphabetical sorting compares two strings by comparing individual characters at same index (position). Alphabetical sorting is quite common as it simpler to implement (or rather harder to screw up) and yields predictable results

    One of many libraries for Python which implements natural sorting https://github.com/SethMMorton/natsort

  • wobfan@lemmy.zip
    link
    fedilink
    arrow-up
    1
    ·
    13 days ago

    i’m not quite sure whether i understood your question but this seems to be right. the 5 from S01E05.*5*.mkv is higher in the alphabet then m from S01E05.*m*kv so it belongs above that entry.