Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Sort Playlist by Release Date via Edit -> Sort By... (Read 1629 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Sort Playlist by Release Date via Edit -> Sort By...

I want to sort a playlist by release date. Problem is, Foobar2000 Edit -> Sort options is limited and doesn't have this option. What sort-pattern do I use to sort a playlist by release date?

I've tried ALL SORT DESCENDING BY %DATE% which only works for Library -> Search. It only works for Library-search, because when I try this same sort-pattern it doesn't behave the same when applying it to Edit -> Sort by...

Any ideas how I can get a playlist to sort by release date being %DATE%?

Thank you.

Re: Sort Playlist by Release Date via Edit -> Sort By...

Reply #1
Hi there,

Add custom sort patterns in Preferences > Advanced > Display > 'Standard sort patterns'.

For descending use something like -

Code: [Select]
date (desc)=$sub(9999,$year(%date%));

Cheers

Re: Sort Playlist by Release Date via Edit -> Sort By...

Reply #2
Cool!!!!!!

Re: Sort Playlist by Release Date via Edit -> Sort By...

Reply #3
Thank you anamorphic, doing that'll create an option to select from Sort as "Edit -> Sort -> Sort by date (desc)". When I apply this option to a playlist the tracks are sorted by date but not accurately. Could this be from me using %date% formatted as "yyyy-mm-dd"?

Also, is there a way to force this option for playlists? Either by creating an autoplaylist or applying the custom sort option?

Re: Sort Playlist by Release Date via Edit -> Sort By...

Reply #4
Thank you anamorphic, doing that'll create an option to select from Sort as "Edit -> Sort -> Sort by date (desc)". When I apply this option to a playlist the tracks are sorted by date but not accurately. Could this be from me using %date% formatted as "yyyy-mm-dd"?

Could be. Change it to include month and day -

Code: [Select]
date (desc)=$sub(9999,$year(%date%))-$sub(99,$month(%date%))-$sub(99,$day_of_month(%date%))

Note you can add secondary fields to sort by, after date -

Code: [Select]
date (desc)=$sub(9999,$year(%date%))-$sub(99,$month(%date%))-$sub(99,$day_of_month(%date%))|$stripprefix(%album artist%)|$stripprefix(%album%)|%discnumber%|%tracknumber%|$stripprefix(%title%)

(Using $stripprefix excludes prefixes to sort other fields alphabetically)

Quote
Also, is there a way to force this option for playlists? Either by creating an autoplaylist or applying the custom sort option?

Sure. Default playlist sorting is done by the library viewer. So it depends, which one you are using?

For auto-playlists, enter your above default sort pattern in Preferences > Shell Intergration > 'Sort incoming files by'. (I think this works as a default for auto-playlists? And without needing to specify SORT in the Library > Search)

For library selection playlists, find the default sort option in Preferences and enter your sort pattern as above (again no need for "date (desc)=" at the beginning) -

Facets = Preferences > Media Library > Facets > 'Default sort order'

Columns UI Filters = Preferences >Display > Columns UI > Filters > Behavior tab > 'Sort tracks added...'

Album List is different, default playlist sorting is the view pattern. There is no clean way to sort descending (by default) without displaying the subtracted dates.

If you really want to default sort by descending dates, I recommend not using Album List. ;) If you want a better tree library I would replace it in your layout with Spider Monkey Panel + Library Tree script, which has far more options. (I can add more detail if needed...)

Cheers