Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
translations translations
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Feature Ideas
| | |-+  Sorting in Files section - Make filenames sort same way as folders do
« previous next »
  • Print
Pages: [1]

Author Topic: Sorting in Files section - Make filenames sort same way as folders do  (Read 243 times)

Offline questions2000

  • Member
  • *
  • Posts: 37
Sorting in Files section - Make filenames sort same way as folders do
« on: April 21, 2025, 07:19:54 PM »
iPod / Linux
This could be viewed as a bug or a new setting to be added.

For me sorting is often an issue on all machines/devices, toughest thing to get the way I prefer.
At first I was surprised because so far Rockbox folder name sorting in the "Files" section appears to be almost perfect.
However, I recently noticed an inconsistency between how folders sort compared to how files sort, they are different.

I am hesitant to make this post because I do not want to lose the sorting method used currently for folders.
This observation has to do with "symbol" characters.

Commonly used "symbols" that are often used in media filenaming are....
dashes -
parentheses (  )   

Below I will provide some examples of how folders and filenames currently sort.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------
FOLDER SORT EXAMPLES
(default sorting for folders works great, this sorting method makes sense to me and is preferred)

DASH
Text
Text - Text

PARENTHESIS
Text
Text (Text)

Text
Text (2)
Text (3)
Text (10)

-----------------------------------------------------------------------------------------------------------------------------------------------------------------
FILENAME SORT EXAMPLES
(Different then folder sort, not desired)

DASH
Text - Text.mp3
Text.mp3     (to me, this would be the original/main version of the name before any dash suffixes are added, I view as being above the others)

PARENTHESIS
Text (Text).mp3
Text.mp3

Parentheses are commonly used by others as suffixes when naming media files.
Here are some examples/explainations below

FILENAME PARENTHESES EXAMPLES
These examples are how filenames currently sort

Sequential Numbering
Text (2).mp3
Text (3).mp3
Text (10).mp3
Text.mp3       (to me this is viewed as "1" and should be above "2")

Indicator For "Live" Version
To me the original version should be above the "Live" version
Artist - Song (Live)
Artist - Song

Indicator For "Featured Artist"
Similar example to one mentioned above, if two versions of a song, one with main artist only and one with a featured artist, seems that the original would be above the featured
Main Artist - Song Name (ft. Artist)
Main Artist - Song Name

To me in every scenario I can think of, parentheses suffixes should always be below the main item without them above.
Same goes for dashes as well.
As mentioned, currently the folder sorting used in Rockbox does this exactly.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------
SUGGESTION
If everyone agrees with the above (to match current folder sorting method), then I would say to make filename sorting match the default sorting method currently used for folders exactly.

If any developers/users do not all agree, then I would say to make both folder and filenames match regardless, but then add a new "sort" based setting that contains two options
Symbol Sorting
-Sort symbols above (which is currently used for filenames)
-Sort symbols below (which is currently used for folders)

Hopefully others agree and hopefully this will be considered to be updated in the future.
Thank you to anyone who reads this
« Last Edit: April 21, 2025, 07:26:27 PM by questions2000 »
Logged

Offline speachy

  • Administrator
  • Member
  • *
  • Posts: 654
Re: Sorting in Files section - Make filenames sort same way as folders do
« Reply #1 on: April 22, 2025, 09:31:34 AM »
Quote from: questions2000 on April 21, 2025, 07:19:54 PM
At first I was surprised because so far Rockbox folder name sorting in the "Files" section appears to be almost perfect.
However, I recently noticed an inconsistency between how folders sort compared to how files sort, they are different.

Filename sorting is done purely on the basis of the numerical value of the current character being compared.

("Filename" in this context _includes_ directories)

What you're effectively asking for is a type of "Semantic" sorting, and that's not something that's likely to be implementable given the multi-lingual nature of rockbox and the very limited resources we tend to have on these players.

Patches welcome, of course.


Logged

Offline questions2000

  • Member
  • *
  • Posts: 37
Re: Sorting in Files section - Make filenames sort same way as folders do
« Reply #2 on: May 07, 2025, 09:08:54 PM »
Thank you for your reply.
I apologize I am not sure I follow.

Might not know what you meant by this
("Filename" in this context _includes_ directories)

If folders already sort this way, then why would filenames be different?
Again I am sorry.
To me it seems like they should be the same (as mentioned, ideally filenames to match the current way folders sort)

I would have no idea on how to achieve something like this.
Would any other developers be interested in adding something like this?
Guess it could be offered as a "sort" setting if other users/developers prefer this current folders sorting different then filename method.

For me, sorting issues can kind of mess up the user experience, have had similar issues in Linux at times as well.
Hopefully someone will be interested in something like this.

Thanks again
Logged

Offline speachy

  • Administrator
  • Member
  • *
  • Posts: 654
Re: Sorting in Files section - Make filenames sort same way as folders do
« Reply #3 on: May 07, 2025, 09:40:27 PM »
These are the _only_ sorting rules/mechanisms that rockbox implements:

 * TYPE (eg audio, playlists, plugins, bookmarks, text files, images, etc.  Type is derived from the extension, but the extension itself is not used in the sorting)
 * DATE
 * ALPHA (ie ordered by comparing the numerical codepoint of each individual character.  This can be problematic for languages that are not English)

There are also ascending/descending variations of each. 

There are existing settings that select which rules to use for sorting files, and which rules to use for directories.  (Note that TYPE only applies to files)
Logged

Offline bahus

  • Member
  • *
  • Posts: 208
Re: Sorting in Files section - Make filenames sort same way as folders do
« Reply #4 on: May 08, 2025, 10:52:38 AM »
Quote from: questions2000 on May 07, 2025, 09:08:54 PM
If folders already sort this way, then why would filenames be different?

It's not different. Full filename consists of name and extension. And the difference you see is caused by extension part. If you name your folders similarly (for instance by adding .dir suffix for each name) you will see the same results:

Folder (2).dir
Folder (3).dir
Folder (10).dir
Folder.dir
« Last Edit: May 08, 2025, 11:30:15 AM by bahus »
Logged

Offline bahus

  • Member
  • *
  • Posts: 208
Re: Sorting in Files section - Make filenames sort same way as folders do
« Reply #5 on: May 10, 2025, 09:21:51 AM »
I've added change request that adds the behavior you want (but it changes behavior of sorting dots in names):
https://gerrit.rockbox.org/r/c/rockbox/+/6548
« Last Edit: May 10, 2025, 09:50:16 AM by bahus »
Logged

Offline questions2000

  • Member
  • *
  • Posts: 37
Re: Sorting in Files section - Make filenames sort same way as folders do
« Reply #6 on: May 18, 2025, 06:10:52 PM »
@bahus
Is that what it is? I had actually run into something like this in the past with Linux sorting, where the dot of the extension did something similar.
I did not even think about this being the issue in RB.
I mean I still prefer filenames to sort the same as how folders currently do, but at least there is a reason for why this occurs.


@bahus
Wow, thank you for doing this.
In the past I had to download the source code for something but I think it was from a different site.
I was not aware of Rockbox using the site you mentioned (Gerrit Code Review)

You mentioned/I saw your post also includes dot folders at top.
When I am viewing on a Linux machine, I think dot folders do show up at top, but that is default behavior of Linux so not sure if it is my file manager/Linux doing this or if Rockbox on device does this as well or not?
But makes sense to me I agree with dot folders (hidden folders) being above all other non dot prefixed folders if they do not do this currently.

Not sure if this will get added, but I really appreciate you putting it in a place where maybe more developers will see this.
I'll keep an eye out in the future to see if this gets added.
Thank you again for doing this.
Logged

Offline bahus

  • Member
  • *
  • Posts: 208
Re: Sorting in Files section - Make filenames sort same way as folders do
« Reply #7 on: May 19, 2025, 04:03:45 AM »
It's been committed. You can test it with the latest daily dev build:
https://www.rockbox.org/daily.shtml
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Feature Ideas
| | |-+  Sorting in Files section - Make filenames sort same way as folders do
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.057 seconds with 16 queries.