getmusicbee.com

Support => Questions => Topic started by: sbakhit on June 02, 2025, 04:00:56 PM

Title: Tracks added to player do not display by Filename A-Z
Post by: sbakhit on June 02, 2025, 04:00:56 PM
If I select 20 tracks in a folder and right-click - "Play With MusicBee", they do not display in the player's playlist in the same order that they were displayed in my Windows folder - by file name, ascending. They instead display in an odd order, probably with meta data sorting. This is really annoying and frustrating when I'm needing to preview large amounts of music in folders and don't know what song I'm listening to because sort order does not match the window it was loaded from. I've checked all the settings and adjusted everything I could, but it still does not default to Filename Ascending. Please fix, and give a very clear option for this that is not buried in your settings.
Title: Re: Tracks added to player do not display by Filename A-Z
Post by: phred on June 02, 2025, 06:16:02 PM
This is not a bug. MB is a music -manager- first and a player second. Being a music manager, MB works best when your tracks are tagged with -at least- artist name, track name, disc-track number, and album name. I'm going to assume your tracks aren't tagged. Or aren't tagged properly. Correct?

If you want the sort order to be by filename, you need to add a column to whatever view you're using. Right-click on any column header > set displayed fields > drag URL from the left side to the right side and position it where you want. Then you can sort on the filename. Note that this will include the full path to the file.

Title: Re: Tracks added to player do not display by Filename A-Z
Post by: sbakhit on June 02, 2025, 07:44:43 PM
I had it sorted by Filename using the column header, but still saw the problem occurring. After more testing, I see it happens when there are numbers before the file name. If a bunch of files are named 05, 08, 18, 24, 36, 112, and that's the order I load them into the player, it will jump from 18 to 112 and then back to 24 because it's only going by the first digit rather than the whole number. Even though sorting by Filename ascending in the player properly sorts all the tracks from smallest to greatest number, it will only read the first 1 or 2 digits and hop around the song order in the list rather than play in numerical order. Has nothing to do with tagging in this case.

When searching for songs in a huge library of thousands of songs, the results in a Windows folder will have a variety of file names and numbers. It's difficult to review them if the player does not see song 112 as being a bigger number and should be lower on the list than filename 24.

In this screenshot, I clicked the Filename header so it would sort the track list by name, but after playing the first track "08 It Takes Two" it jumped down to "115 - It Takes Two..." rather than play 09.
https://imgur.com/PMiI2lM (https://imgur.com/PMiI2lM)
https://imgur.com/PMiI2lM
Title: Re: Tracks added to player do not display by Filename A-Z
Post by: Pickles7853 on June 04, 2025, 02:09:00 AM
I think it might be possible to force it into correct order by using a virtual function to modify the name MusicBee sees.

First you would need to create the function: Preferences >> Tags (1) >> Define New Tags.
In the bottom half of the dialog window you will find a list of functions.
If they are blank it will be labeled "Virtual#" with nothing in the formula section beside it.
Find a blank one and rename the label to something useful like: PadFileName
In the right side paste this in: $RxReplace(<Filename>,"^\d+",$Pad($RxMatch(<Filename>,"^\d+"),5))
This basically says if the filename starts with a number, replace it with the same number but pad it to five digits.
For example "12-this file name.mp3" will turn into "00012-this file name.mp3"
Note: this will not rename the file physically.  It only changes what is seen by MusicBee.
Now, save and exit.
In your header where you are sorting by filename, change filename to PadFileName and sort this and see if it behaves more to your expectations...
Title: Re: Tracks added to player do not display by Filename A-Z
Post by: sbakhit on June 04, 2025, 02:30:01 AM
I really appreciate the advice. However, when the tracks play, they display this way. (The folder tracks are on the left and music player on the right).
https://imgur.com/OGKQFoT
Title: Re: Tracks added to player do not display by Filename A-Z
Post by: Pickles7853 on June 04, 2025, 02:41:01 AM
Ah that's my fault.  The color tag is reformatting the RegEx... I think I fixed it but just in case lets see if a code block is better.
Code
$RxReplace(<Filename>,"^\d+",$Pad($RxMatch(<Filename>,"^\d+"),5))

Edit: yeah that looks better...
Title: Re: Tracks added to player do not display by Filename A-Z
Post by: sbakhit on June 04, 2025, 02:52:22 AM
Unfortunately, I still see a bunch of code in the file name like the first time.
Title: Re: Tracks added to player do not display by Filename A-Z
Post by: Pickles7853 on June 04, 2025, 03:20:35 AM
Kind of strange.
When I cut-&-paste the code in the editor it sometimes tries to add in escape characters on the double quotes.
When you paste it into the formula section hit the ellipse button for the formula on the far right; EG the "..." button.
Here it can be tested.  If you click the "preview" button it will expand and show what it will look like when enabled.
Basically - double check when you paste the code it looks just like it does above.
I hope you can get it working.  The code is correct...

(https://i.postimg.cc/PqPn2872/Untitled.png)
Title: Re: Tracks added to player do not display by Filename A-Z
Post by: sbakhit on June 04, 2025, 02:59:22 PM
https://imgur.com/a/kTL72h1

Seems the link changes after it's saved. I went back in to match your picture, but it still messes up. It's not worth spending more time on this, and I do appreciate your help, but could you please give your dev team feedback to fix this in the next update so that custom code isn't needed?
Title: Re: Tracks added to player do not display by Filename A-Z
Post by: hiccup on June 04, 2025, 03:44:53 PM
…but could you please give your dev team feedback to fix this in the next update so that custom code isn't needed?
There is nothing that needs fixing.
Titles and names are text fields, not numeric fields.
So sorting will (and should) be done natural alphanumerical.
Title: Re: Tracks added to player do not display by Filename A-Z
Post by: sbakhit on June 04, 2025, 03:55:56 PM
It does need fixing because Windows displays it "naturally"...in the proper numerical order, as my first screenshot showed. If you have 05, 15, 08, 112, and 37, Windows will sort them in numerical order like an A-Z listing, the way it should be. But your program does not do this, as my previous messages showed. That is incorrect.
Title: Re: Tracks added to player do not display by Filename A-Z
Post by: hiccup on June 04, 2025, 04:12:02 PM
Windows will sort them in numerical order like an A-Z listing, the way it should be. But your program does not do this, as my previous messages showed. That is incorrect.
MusicBee is not a file manager.
MusicBee is a music manager that is intended for people that care about having their metadata (tags) in order.

If you don't care much about tagging your music properly, perhaps check out some more basic 'file' players.
See item #8 in my signature for many good suggestions.
Title: Re: Tracks added to player do not display by Filename A-Z
Post by: hiccup on June 04, 2025, 04:22:06 PM
Code
$RxReplace(<Filename>,"^\d+",$Pad($RxMatch(<Filename>,"^\d+"),5))
That is very clever.
Title: Re: Tracks added to player do not display by Filename A-Z
Post by: karbock on June 04, 2025, 05:22:31 PM
@sbakhit:

You came across two problems. The one without a solution for now, the other with a solution.


Example below in three steps:

(https://i.imgur.com/rezrCUJ.png)

(https://i.imgur.com/PSCCInD.png)

(https://i.imgur.com/mV9zoE5.png)
Title: Re: Tracks added to player do not display by Filename A-Z
Post by: sbakhit on June 04, 2025, 05:24:05 PM
Ok, I'll keep that in mind. Thank you again for your help.