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: Choose ascending/descending order when using sort pattern on playlists (Read 1675 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Choose ascending/descending order when using sort pattern on playlists

I have an autoplaylist that I use to sort my library by %added%. The sort pattern looks like this:
Code: [Select]
$date(%added%)

However, the playlist is sorted in ascending order, so I have to scroll to the bottom of this lengthy playlist to see my most recently-added music. Is there a way to specify that the playlist should be sorted in descending order, so that the most recently-added music appears at the top of the playlist?

Re: Choose ascending/descending order when using sort pattern on playlists

Reply #1
Is it like this?

$sub(99999999,$replace(%added%,-,)) - $swapprefix(%album artist%) - $sub(3000,%date%) -%ALBUM% - %DISCNUMBER% - %TRACKNUMBER% - %TITLE%
-----
$sub(99999999,$replace(%file_created%,-,)) - $swapprefix(%album artist%) - $sub(3000,%date%) -%ALBUM% - %DISCNUMBER% - %TRACKNUMBER% - %TITLE%
-----
Pathinfo (foo_pathinfo) Latest Download: https://hydrogenaud.io/index.php/topic,124568.msg1031345.html#msg1031345
$date(%folder_created%) →  yyyy-mm-dd
$sub(99999999,$replace(%folder_created%,-,)) - $swapprefix(%album artist%) - $sub(3000,%date%) -%ALBUM% - %DISCNUMBER% - %TRACKNUMBER% - %TITLE%
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, HIFIMAN ANANDA, Bowers & Wilkins P7, FiiO FT5, FiiO FT1 Pro, 水月雨 (MOONDROP) 空鳴 - VOID, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: Choose ascending/descending order when using sort pattern on playlists

Reply #2
Thanks for the suggestions. I'm not sure I understood your post, but I tried the first option and it didn't sort it correctly. The second option appears to sort by file creation date, and also didn't work correctly. I'm not sure what the third option is about.

It appears that for a regular search query, there's syntax such as "SORT DESCENDING BY," but this doesn't work in the sort pattern field of an autoplaylist. I tried "SORT DESCENDING BY $date(%added%)".

I also tried a search query like "%path% HAS D:\Music SORT DESCENDING BY %added%" but got the error "Sort operations not available in this context." Is there another way to compose the query?

Re: Choose ascending/descending order when using sort pattern on playlists

Reply #3
I just use this
Code: [Select]
%added% DURING LAST 4 WEEKS SORT DESCENDING BY "$date(%added%)"

Re: Choose ascending/descending order when using sort pattern on playlists

Reply #4
Oops.
This is how to use it in "menu > Edit > Sort > Sort by...".

It is more practical to add a sort pattern here.
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, HIFIMAN ANANDA, Bowers & Wilkins P7, FiiO FT5, FiiO FT1 Pro, 水月雨 (MOONDROP) 空鳴 - VOID, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: Choose ascending/descending order when using sort pattern on playlists

Reply #5
I just use this
Code: [Select]
%added% DURING LAST 4 WEEKS SORT DESCENDING BY "$date(%added%)"

I tried this, but I increased the 4 weeks to 5000, since I want to see my entire library. That did some sort of sorting, but then I noticed that some albums started to no longer be grouped together  - I guess that's due to how they were added to the library. Removing the "LAST 4 WEEKS" didn't produce any results. Is there a way to achieve what I want with viewing the whole library?

Oops.
This is how to use it in "menu > Edit > Sort > Sort by...".

It is more practical to add a sort pattern here.

This option is greyed out; I'm assuming it's because I'm using an autoplaylist?

Re: Choose ascending/descending order when using sort pattern on playlists

Reply #6
No.
Media Library Search:
%added% DURING LAST 12 WEEKS
Create Auto Playlist

Playlist View: click Track. Then click Edit > Select all.

Edit > Sort > Sort by ...
$sub(99999999,$replace(%added%,-,)) - $swapprefix(%album artist%) - $sub(3000,%date%) -%ALBUM% - %DISCNUMBER% - %TRACKNUMBER% - %TITLE%
-----
Playlist View Columns
Added: $date(%added%)
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, HIFIMAN ANANDA, Bowers & Wilkins P7, FiiO FT5, FiiO FT1 Pro, 水月雨 (MOONDROP) 空鳴 - VOID, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: Choose ascending/descending order when using sort pattern on playlists

Reply #7
I tried this, but I increased the 4 weeks to 5000, since I want to see my entire library. That did some sort of sorting, but then I noticed that some albums started to no longer be grouped together  - I guess that's due to how they were added to the library. Removing the "LAST 4 WEEKS" didn't produce any results. Is there a way to achieve what I want with viewing the whole library?

You can use ALL to return whole library -

Code: [Select]
ALL SORT DESCENDING BY "$date(%added%)"

Use this as the query proper (no need to bother with the 'Sort pattern' box)

Note that foobar v2.0 has a sorting bug with auto-playlists. Update to v2.1 preview should fix the strange grouping / sorting issue.

Re: Choose ascending/descending order when using sort pattern on playlists

Reply #8
You can use ALL to return whole library -

Code: [Select]
ALL SORT DESCENDING BY "$date(%added%)"

Use this as the query proper (no need to bother with the 'Sort pattern' box)

Note that foobar v2.0 has a sorting bug with auto-playlists. Update to v2.1 preview should fix the strange grouping / sorting issue.

Worked perfectly, and a very straightforward solution. I wsn't aware that I could use ALL - I had been specifying the path of the music library manually all this time.

Thank you anamorphic and Air KEN :)