Menu

#201 title sort question / issue

3.7.1
closed
nobody
None
1
2019-08-24
2019-06-22
Tom
No

This might be more of a question than a bug, but I noticed that kid3 sorts (in the list of songs) "artist_-title_remix.ext" before "artist-_title.ext" - that is not correct from either an ascii (2e before 5f) or alphabetical (if sorting on the title, as an item with fewer characters should come before an item with more characters if all of the characters match) sort.

Can you tell me the reason for this (and if it is unintentional, would you consider "fixing" it)? :)

Thank you.

Discussion

  • Tom

    Tom - 2019-06-22

    Don't know why italics showed up in there. The entries are supposed to be (I will put them as code this time):

    artist_-_title_remix.ext
    artist_-_title.ext
    

    Anyway, that is the order that kid3 displays them, but I believe the second song should come first.

     
  • Urs Fleisch

    Urs Fleisch - 2019-06-22

    I am a bit hesitant what to do in this case. If you look at the behavior of certain applications, both behaviors can be seen:

    Kid3 (Linux, Mac), Finder (Mac), dolphin (KDE):

    artist_-_title_remix.mp4
    artist_-_title.mp4
    

    Kid3 (Windows), ls, Nautilus (Gnome), Explorer (Windows):

    artist_-_title.mp4
    artist_-_title_remix.mp4
    

    I personally would also think that your suggested behavior is the correct one. The behavior seems to be given by Qt, which uses ICU on Linux by default. ICU is also used on the Mac. I do not know why ICU is behaving like this. Because I use my own fixed version of the Qt file system model in Kid3, this issue could be fixed like this:

    index 65479285..0cd12b39 100644
    --- a/src/core/model/filesystemmodel.cpp
    +++ b/src/core/model/filesystemmodel.cpp
    @@ -1049,6 +1049,7 @@ public:
         {
             naturalCompare.setNumericMode(true);
             naturalCompare.setCaseSensitivity(Qt::CaseInsensitive);
    
    +        naturalCompare.setIgnorePunctuation(true);
         }
    
         bool compareNodes(const FileSystemModelPrivate::FileSystemNode *l,
    

    This will probably ignore both the . and _ characters (and all the other punctuation characters), which could lead to other less desired side effects. Maybe I should make it configurable?

     
  • Tom

    Tom - 2019-06-22

    I would be happy with something configurable. I use linux, and actually override the locale for sorting in the shell ("LC_COLLATE=POSIX"), even though KDE doesn't use any of that locale information, so a POSIX sort option (to match what I see in a shell) would more than satisfy me. :)

    Thanks, again.

     
  • Urs Fleisch

    Urs Fleisch - 2019-06-23

    This is now fixed in version git20190623 which can be found in the development folder.
    Note, however, that this configuration option is not in the GUI, you have to quit Kid3 and modify the settings (e.g. ~/.config/Kid3/Kid3.conf for kid3-qt, ~/.config/kid3rc for the KDE version) to have SortIgnoringPunctuation=true in the section [Files].

     
  • Urs Fleisch

    Urs Fleisch - 2019-08-24
    • status: open --> closed
     
  • Urs Fleisch

    Urs Fleisch - 2019-08-24

    Is now fixed in version 3.8.0.

     
MongoDB Logo MongoDB