Author Topic: Tracks added to player do not display by Filename A-Z  (Read 1480 times)

sbakhit

  • Newbie
  • *
  • Posts: 10
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.
Last Edit: June 02, 2025, 04:08:23 PM by [email protected]

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10265
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.

Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

sbakhit

  • Newbie
  • *
  • Posts: 10
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

Pickles7853

  • Full Member
  • ***
  • Posts: 149
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...

sbakhit

  • Newbie
  • *
  • Posts: 10
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

Pickles7853

  • Full Member
  • ***
  • Posts: 149
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...
Last Edit: June 04, 2025, 02:44:13 AM by Pickles7853

sbakhit

  • Newbie
  • *
  • Posts: 10
Unfortunately, I still see a bunch of code in the file name like the first time.

Pickles7853

  • Full Member
  • ***
  • Posts: 149
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...


sbakhit

  • Newbie
  • *
  • Posts: 10
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?

hiccup

  • Hero Member
  • *****
  • Posts: 9107
…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.
Last Edit: June 04, 2025, 04:28:26 PM by hiccup

sbakhit

  • Newbie
  • *
  • Posts: 10
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.

hiccup

  • Hero Member
  • *****
  • Posts: 9107
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.

hiccup

  • Hero Member
  • *****
  • Posts: 9107

karbock

  • Sr. Member
  • ****
  • Posts: 549
@sbakhit:

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

  • When you selected the files in the File Explorer, the order you saw in the File Explorer was not respected in MusicBee's Now Playing list.
    For this in particular, I don't know the reason.
  • But then, within MusicBee, you sorted the Now Playing list on 'Filename' and expected MusicBee to follow that new order when playing.
    For this to be the case, you must first:
    - right-click somewhere in the list
    - select List -> Update Play Order

    Otherwise, sorting on 'Filename' only affects the display order, not the play order.
    You can check the playing order with the '#' column (add it to the displayed fields if needed),
    and observe that its content changes when applying 'Update Play Order' after a new sort.

Example below in three steps:






sbakhit

  • Newbie
  • *
  • Posts: 10