Folder sorting puts numbers before underscore-prefixed folders

Feature description

Sorting folder names using a collation where _ sorts before numbers and letters

Problem solved

I’m using Symfonium to browse a music library by its physical folder structure. I’ve tested this with two different media providers:

  • SMB directly to the music folder
  • Navidrome/Subsonic using a development branch that exposes the actual physical folder hierarchy through getIndexes / getMusicDirectory
    Folder browsing itself works very well with both providers. However, Symfonium sorts the top-level folders like this:
    2010’s
    2020’s
    3 Doors Down
    311
    4 Non Blondes
    __Audio Test Songs
    __Playlists exports
    __Songs_In
    A…
    B…
    C…

I would like the underscore-prefixed folders to sort before the numeric folders, i.e.:
__Audio Test Songs
__Playlists exports
__Songs_In
2010’s
2020’s
3 Doors Down
311
4 Non Blondes
A…
B…
C…

I tested both Default and Name sorting in Symfonium and get the same result.
I also tested both the SMB provider and Subsonic/Navidrome provider, and Symfonium produces the same numbers → underscores → letters ordering with both. That makes it appear that the ordering is Symfonium’s own folder-name collation rather than something coming from the server.
For comparison, Amperfy browsing the same physical folder hierarchy through the same Navidrome/Subsonic server puts the underscore-prefixed folders first, which is the behavior I’m looking for.
The leading underscores are intentional. I use them for utility/special folders that I want pinned to the top of a large music directory.
Is there an existing setting I’ve missed that controls punctuation/special-character sorting? If not, would you consider either:

  1. Sorting folder names using a collation where _ sorts before numbers and letters, or
  2. Adding an option to use a simple/ordinal folder-name sort or otherwise control where punctuation sorts?
    Alternatively, if Default is intended to preserve the order supplied by the media provider, I’d be interested in knowing whether Symfonium is re-sorting that result internally.
    Thanks!

Brought benefits

More conventional sort order, and aligns with Navidrome / Subsonic

Device type

All

I searched existing feature requests

on

Thank you for the detailed examples. I don’t currently offer a setting to put underscore-prefixed folder names before numbers. Name sorting uses case-insensitive string ordering, where digits come before _; a plain ordinal sort would also put digits first.

Default keeps the order returned by the provider. For Subsonic, it follows the order of the getIndexes/getMusicDirectory response, so matching results with Default don’t by themselves show that the browser is re-sorting the server response.

Thanks — your explanation of how Default sorting works pointed me in the right direction.

I’m testing a development build of Navidrome based on PR #5188, which adds physical-folder browsing to the Subsonic getIndexes / getMusicDirectory responses. I looked at the server code and found that it was explicitly sorting the top-level physical folders case-insensitively by name before returning them:

sort.Slice(allFolders, func(i, j int) bool {
    return strings.ToLower(allFolders[i].Name) < strings.ToLower(allFolders[j].Name)
})

So you were exactly right: with Default selected, Symfonium was simply displaying the order Navidrome supplied.

Since I intentionally use leading underscores to keep a few utility folders at the top of a large music directory, I made a very small local change to the Navidrome build. The comparison now checks whether a folder starts with _ first, then uses the existing case-insensitive name comparison within each group.

Navidrome now returns:

__Audio Test Songs
__Playlists exports
__Songs_In
2010's
2020's
3 Doors Down
311
4 Non Blondes
A...

I rebuilt Navidrome and tested Symfonium with Default sorting, and it works perfectly — the underscore folders now appear first. Name sorting, of course, continues to use Symfonium’s normal ordering.

I also tested the same physical-folder implementation with Amperfy, and folder browsing is working well there too.

So no change is needed in Symfonium for my use case. Your clarification that Default preserves the provider order gave me exactly what I needed to solve this cleanly on the server side.

Thanks for the quick and detailed response!