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: Library Tree Add On, Sorting (Read 1718 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Library Tree Add On, Sorting

Hi all. Just discovered the brilliant Library Tree Viewer add on and it's great. However, I have a large collection and like to order things in Date Added order. The nearest I've come with F2K is to sort by date modified. I've managed to add this in Library Tree in the Views menu, using this string: $cut(%last_modified%,10)|%filename_ext% This works fine but the list is viwed from the oldest at the top to the newest at the bottom. Is there a way I can change this, either by changing the above string or is there a way in Library Tree itself?

Re: Library Tree Add On, Sorting

Reply #1
for example:
$sub(99999999,$replace(%added%,-,)) - %DISCNUMBER% - %TRACKNUMBER% - %TITLE%

$sub(99999999,$replace(%added%,-,)) - $swapprefix(%album artist%) - $sub(3000,%date%) - %ALBUM% - %DISCNUMBER% - %TRACKNUMBER% - %TITLE%
$sub(99999999,$replace(%added%,-,)) - $sub(3000,%date%) - $swapprefix(%album artist%) - %ALBUM% - %DISCNUMBER% - %TRACKNUMBER% - %TITLE%

$date(%added%): yyyy-mm-dd
-----
%file_created%
$sub(99999999,$replace(%file_created%,-,)) - $swapprefix(%album artist%) - $sub(3000,%date%) -%ALBUM% - %DISCNUMBER% - %TRACKNUMBER% - %TITLE%
$sub(99999999,$replace(%file_created%,-,)) -$sub(3000,%date%) - $swapprefix(%album artist%) - %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: Library Tree Add On, Sorting

Reply #2
Tried all these and I just get "Nothing Found". Even with the built-in default Library Tree script for Recently Added.

Re: Library Tree Add On, Sorting

Reply #3
Oops, these were sorting patterns.
It would be better to use Filters.
https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Query_syntax
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: Library Tree Add On, Sorting

Reply #4
SORT DESCENDING BY %added% does not seem to be available in Filters.
Of course, you can use it in Library Search.

menu > Library > Search
%added%  DURING LAST 300 WEEKS SORT DESCENDING BY %added%

$sub(99999999,$replace(%added%,-,),) $date(%added%)|$swapprefix(%album artist%)|$sub(3000,%date%,) [%ALBUM% - ][%date%]|[%discnumber%. ][%tracknumber% - ]%title%

Now I know that it can be displayed.
Subtracted values ​​do not display or can't be successfully replaced by fields.
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: Library Tree Add On, Sorting

Reply #5
"Last Modified" dates are not ideal for finding most recently added music. If you install Playback Statistics it has an %added% field which records the date/time music was added to library, and is not changing when you modify files. The downside is if you only newly installed it, everything gets the same added date (current date), so not immediately useful until you add new albums.

In title formatting (library view patterns), to get descending dates you subtract the dates like Air KEN was attempting. Library Tree has a custom $nodisplay function for sorting views, so the view pattern should look like -

Code: [Select]
$nodisplay{$sub(99999999999999,$replace($date(%last_modified%),-,))}$date(%last_modified%)|%filename_ext%

^ This only sorts by the $date part of %last_modified%, which means tracks will be grouped by day, rather than the precise minutes and seconds they were modified which would most likely group everything separately. (If you use Playback Statistics you can swap %last_modified% for %added% in both places above)

^ For secondary branch %filename_ext%, keep in mind Library Tree sorts the playlist by the complete view pattern, so depending on your filename structure you might need more fields to keep the playlist organized (or just use standard tags here like %discnumber% etc, or put them in another $nodisplay)



Subtracted values ​​do not display or can't be successfully replaced by fields.
It was not working because $sub function only accepts numbers, but %added% field (and other dates) have a dash, space, and colon which also need replacing -

Code: [Select]
$sub(99999999999999,$replace(%last_modified%,-,, ,,:,))


Re: Library Tree Add On, Sorting

Reply #6
@anamorphic Thanks.

Is this the right one for me?
It can be displayed for now.

$nodisplay{$sub(99999999999999,$replace($date(%added%),-,))}$date(%added%)|$swapprefix(%album artist%)|$nodisplay{$sub(3000,$replace($sub(3000,%date%,),,))}[%ALBUM% - ][%date%]|[%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: Library Tree Add On, Sorting

Reply #7
^ It depends if you have any %date% tags in YYYY-MM-DD format or just YYYY format? This should work either way though -

Code: [Select]
$nodisplay{$sub(99999999999999,$replace($date(%added%),-,))}$date(%added%)|$swapprefix(%album artist%)|$nodisplay{$sub(99999999,$replace(%date%,-,))}[%album%][ - %date%]|[%discnumber%. ][%tracknumber% - ]%title%


Re: Library Tree Add On, Sorting

Reply #8
@anamorphic Thanks again.

@Richard127
Give it a try.

Also, try Library Search, which is mentioned above. It allows you to create flexible Auto Playlists.
Also, please make effective use of menu > Edir > Sort > Sort by...
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)