Skip to content

Conversation

@djinnalexio
Copy link

addressing issue johnfactotum/foliate#1549

The expected behaviour is that 2.jpg displays before 10.jpg. This is standard behaviour in MComix, Okular, Calibre, Evince, Panels (iOS), CDisplayEX (Android), and many others.

@johnfactotum
Copy link
Owner

I understand that there may not be a real standard but has this been specced somewhere?

@djinnalexio
Copy link
Author

I understand that there may not be a real standard but has this been specced somewhere?

I don't understand the phrase.

But like I quoted, multiple apps support it and even file managers like Nautilus follow this behavior. Normally, comic archives follow the proper strict numbering with leading zeros, but there are the handful of cbz files that fail to do so. This solution makes sure the app can handle them anyway instead of having the user have to manually rename the files in the archive.

@johnfactotum
Copy link
Owner

Well, I mean how or where is "natural sorting" defined? The way Nautilus sorts is dependent on the locale. And of course when using localeCompare or Intl.Collator, etc., if you don't specify a locale, or even if you do, the behavior is different depending on the host configuration. And specific to CBZ, here it's sorting by the base filename excluding the leading path. So I'm just wondering if there is some sort of standard that one can refer to, like e.g. one of those attempted comic book archive specifications, or some specific implementation that one can refer to. And for example, why parse the string manually rather than simply relying on the collator with numeric: true? And why do you need to set sensitivity: 'base'? It's not immediately clear why it does these specific things without some concrete reference, or at least some examples. That's what I'm wondering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants