HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: db78 on 2007-04-22 14:54:57

Title: Problem With Recently Added
Post by: db78 on 2007-04-22 14:54:57
I made a playlist of recently added songs based on what people told me in this thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=53436&hl=recently+added). 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.

(http://img.photobucket.com/albums/0903/gbadude/outoforder.jpg)

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!
Title: Problem With Recently Added
Post by: kanak on 2007-04-22 18:13:34
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%
Title: Problem With Recently Added
Post by: db78 on 2007-04-22 21:44:27
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.
Title: Problem With Recently Added
Post by: buktore on 2007-04-23 03:46:21
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.
Title: Problem With Recently Added
Post by: db78 on 2007-05-04 02:54:12
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?
Title: Problem With Recently Added
Post by: kanak on 2007-05-04 02:59:40

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.
Title: Problem With Recently Added
Post by: db78 on 2007-05-04 03:58:26


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)),'-',,':',,' ',))
Title: Problem With Recently Added
Post by: kanak on 2007-05-04 05:06:57
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.)
Title: Problem With Recently Added
Post by: db78 on 2007-05-04 07:01:38
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!