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: Problem With Recently Added (Read 4195 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Problem With Recently Added

I made a playlist of recently added songs based on what people told me in this thread. It works almost perfectly. It does list all the recently added music, but the playlist is out of order. For example I add an Aerosmith CD to my playlist by using the file operations. When I go into the recently added playlist, all tracks aren't listed under the same entry, it's scattered around.



I want it so all the songs under the same album are listed under the same album in order of tracknumber, and not scattered around.

query
Quote
%date added% HAS "-" AND "$cwb_datediff(%date added%,%cwb_systemdate%)" LESS 4


sort
Quote
$sub(99999999999999,$replace(%last_played%,'-',,':',,' ',))


thanks!

Problem With Recently Added

Reply #1
Your problem is that you're sorting by last_played instead of date added.

If you want it to be chronological, i'd suggest:
Code: [Select]
$sub(99999999999999,$replace(%date added%,'-',,':',,' ',))

Note: For a better measure, you might want to crop the date added so that it drops the "seconds" part of the value (e.g. just 2007-01-10 03:21 instead of 2007-01-10 03:21:20). Then ALSO sort by artist and album:
Code: [Select]
$sub(999999999999,$replace($left(%date added%,$sub($len(%date added%),2)),'-',,':',,' ',)),%artist%,%album%

Problem With Recently Added

Reply #2
Your problem is that you're sorting by last_played instead of date added.

If you want it to be chronological, i'd suggest:
Code: [Select]
$sub(99999999999999,$replace(%date added%,'-',,':',,' ',))

Note: For a better measure, you might want to crop the date added so that it drops the "seconds" part of the value (e.g. just 2007-01-10 03:21 instead of 2007-01-10 03:21:20). Then ALSO sort by artist and album:
Code: [Select]
$sub(999999999999,$replace($left(%date added%,$sub($len(%date added%),2)),'-',,':',,' ',)),%artist%,%album%


I tried using the second code. Now it's sorted by alphabetical order and not chronological, but at least the tracks are together now.

Problem With Recently Added

Reply #3
the first code should do the trick if you add the whole album at the same time.

try this. newly added should be at the top.

Quote
$sub(999999999999,$replace($left(%date added%,$sub($len(%date added%),2)),'-',,':',,' ',))


and thanks to kanak. dropping the seconds part seem to make my autoplaylist update faster.

Problem With Recently Added

Reply #4
the first code should do the trick if you add the whole album at the same time.

try this. newly added should be at the top.

Quote
$sub(999999999999,$replace($left(%date added%,$sub($len(%date added%),2)),'-',,':',,' ',))


and thanks to kanak. dropping the seconds part seem to make my autoplaylist update faster.


Sweet I got it to organize by album, the only problem now is that the newly added albums are at the bottom of the playlist, is there a way to make it at the top? Also under each album, the tracks aren't in order. I'm guessing foobar doesn't add the tracks in order, but is there a way to have them sorted in order within each album?

Problem With Recently Added

Reply #5

the first code should do the trick if you add the whole album at the same time.

try this. newly added should be at the top.

Quote
$sub(999999999999,$replace($left(%date added%,$sub($len(%date added%),2)),'-',,':',,' ',))


and thanks to kanak. dropping the seconds part seem to make my autoplaylist update faster.


Sweet I got it to organize by album, the only problem now is that the newly added albums are at the bottom of the playlist, is there a way to make it at the top?


That's strange. The $sub thing should make the latest added files appear at the top. Could you post your sort string? Also, try refreshing the playlist.

Problem With Recently Added

Reply #6


the first code should do the trick if you add the whole album at the same time.

try this. newly added should be at the top.

Quote
$sub(999999999999,$replace($left(%date added%,$sub($len(%date added%),2)),'-',,':',,' ',))


and thanks to kanak. dropping the seconds part seem to make my autoplaylist update faster.


Sweet I got it to organize by album, the only problem now is that the newly added albums are at the bottom of the playlist, is there a way to make it at the top?


That's strange. The $sub thing should make the latest added files appear at the top. Could you post your sort string? Also, try refreshing the playlist.


Query:
Code: [Select]
%date added% HAS "-" AND "$cwb_datediff(%date added%,%cwb_systemdate%)" LESS 4


Sort:
Code: [Select]
$sub(999999999999,$replace($left(%date added%,$sub($len(%date added%),2)),'-',,':',,' ',))

 

Problem With Recently Added

Reply #7
I think i found the culprit: it's not the sort code but your autoplaylist query. If your date added is of the form YYYY-MM-DD HH:MM:SS, you should find the difference with %cwb_systemdatetime% (NOT %cwb_systemdate)

so, the autoplaylist code should now be:

Code: [Select]
%date added% HAS "-" AND "$cwb_datediff(%date added%,%cwb_systemdatetime%)" LESS 4


i also re-wrote the sort code (should be more efficient):


Code: [Select]
$sub(999999999999,$replace($left(%date added%,$sub($len(%date added%),3)),'-',,':',,' ',)),%album artist%,%album%


(I'm assuming your Date added format is: YYYY-MM-DD HH:MM:SS . What i've done is to strip the :SS part, then remove the dashes, the colons and the space, and subtract it from a large number to get it to sort by latest added. Then it sorts by album artist and the album.)

Problem With Recently Added

Reply #8
Yes!! Oh good lord thank you so much. It's been bugging me for so long. I also changed my custom sort to systemdatetime, and it's working perfectly now. Thank you so much!