Sort order wrong for hyphenated names

Hi, I just noticed today, after turning on ‘show file names’ that digikam is not sorting some names correctly. I use exiftool to rename files to their date and if multiple photos where taken in the same second appends a number. So I would like my files to be sorted like this:
2021_06_03__15_10_37
2021_06_03__15_10_37-1
2021_06_03__15_10_37-2

but digikam sorts out of order, like this:
2021_06_03__15_10_37-1
2021_06_03__15_10_37-2
2021_06_03__15_10_37

This is a big pain for me as I have thousands of bracketed shots. Is there a way to deal with this in digikam? Or do I need to fix the issue in exiftool and rename everything using a different formula?

Thanks

I tested it here under Windows, the sort order is the way you expected. Which digiKam version under which operating system do you use.

7.3 and 7.2 on MX linux which is debian based.

Ok, now here on my Linux computer the sorting is actually like you complained about. Switching between normal and natural character string comparison in the digiKam setup does nothing. I’ll check it out, but the file manager Dolphin sorts just like digiKam. At the moment I only have one guess for the difference between Windows and Linux in the sorting. The sorting in Qt also depends on an external library.

Is “2021_06_03__15_10_37” (without the quotes) the actual filename? Or do you have extensions, for example “2021_06_03__15_10_37.tif”?

If you have extensions, then the usual ASCII ordering has hyphen “-” ordering before dot “.”, so “2021_06_03__15_10_37-2.tif” will come before “2021_06_03__15_10_37.tif”.

EDIT to add: I don’t know if digiKam sorts on the entire filename including any extension, or if it ignores the final dot and anything after it, or it sorts on something else.

Thanks for verifying. Hopefully we can find a work a workaround.

Yes it is. Thanks for the Ascii tip, maybe that’s it. It would be a strange choice, I think, to sort file names like that, but maybe it’s a bug.