HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: canuckken on 2018-08-10 11:36:04

Title: NG Playlist Track Sorting
Post by: canuckken on 2018-08-10 11:36:04
How do I get my playlist to sort the tracks in order of track number? I have to manually right click and select  "sort ascending" every time. The actual track numbers are correct because I  edited the metadata under properties.
Title: Re: NG Playlist Track Sorting
Post by: PleasantSounds on 2018-08-11 02:30:18
The default loading order appears to be driven by file names, not the metadata. My library is organised so that the track number is included in the file name and then they always come up in the right order in the playlist.

You can also try doing this the hard way, for example using JScript panel you could hook up to the on_playlist_switch callback and call plman.SortByFormat using any sort pattern you want.
Title: Re: NG Playlist Track Sorting
Post by: canuckken on 2018-08-11 10:25:47
Thanks for the reply. I noticed that not all my files had this problem but strangely the ones that were not displaying in order were the ones that I had the track number in the file name.  I deleted the track numbers in the file names and they appear to be displaying correctly now but I am not sure if that fixed it or if it was something else I did.
Anyway everything appears to be fine now, I just don't know why, lol. 
Title: Re: NG Playlist Track Sorting
Post by: canuckken on 2018-08-11 10:44:07
OK, I figured it out. The problem was with the filter panel script. If I opened my files directly with foobar the files would be displayed in the correct order, if I selected them from the filter panel they would be scrambled. The reason was because the default script is this...  %album artist% - %album% - %discnumber% - %tracknumber% - %title%
I simply changed it to this... %tracknumber% - %album artist% - %album% - %discnumber% - %title%
It had to have %tracknumber% at the beginning.
Title: Re: NG Playlist Track Sorting
Post by: PleasantSounds on 2018-08-11 16:08:57
That's going to give you what you want when you open only one album at a time.
If you open for example all albums of  the same artist, you may not like the result...

The correct way is to maintain both <album artist> and <artist> tags - at least for compilation albums. You can put anything in the <album artist>, as long as it is the same value for all tracks on the album - e.g. "Various Artists" or "Compilation".  If this tag is not populated, fb will use <artist> instead.
Title: Re: NG Playlist Track Sorting
Post by: canuckken on 2018-08-12 02:18:08
You are correct. I thought it was working correctly but I tried selecting all albums as you explained and the results gave me all track numbers of all the albums combined in numerical order, ie... 11111 22222 33333.
I changed the script to this %album artist% - %album% - %tracknumber% - %discnumber% - %title% and it seems to be working the way that I want it to now, see the sellected "artist" and "all abums" in the filter panels in this screenshot...