Help - Search - Members - Calendar
Full Version: How to sort by %play_count%, %last_played%
Hydrogenaudio Forums > Hosted Forums > foobar2000 > General - (fb2k)
barry123
QUOTE(Keikonium @ Jun 29 2007, 08:25) *

Here is something I have been working on for about 3 weeks now smile.gif. It's far from done, I still need to add all the settings and stuff, a bunch of track info on the left, finish up adding some panels and such... just felt like posting something smile.gif.

large screenshot of a rather colorful foobar2000

does the V (in the colums playlist after artist, number, album, bitrate) means how many times you've played the track?
I want the same but when I sort to most played it shows me the first click from low to high number.
I have to hit twice to go from high number to low.
It's kind of annoying when there are 1000 songs in my playlist.
I guess it's because track number have to be from low to high, but I dont know how to change this.

question 2, how do you get the 0 before the numbers like:
01
02
03
04
05
06
07
08
09
10

I use this now:

display tab:
$if($strcmp(%PLAYCOUNT%,?),
0 times,
$if($strcmp(%PLAYCOUNT%,1),
%PLAYCOUNT% time,
%PLAYCOUNT% times
))

sort tab:
$num(%PLAYCOUNT%,100)

-- Moderation: Turned screenshot in the quote into a link.
kanak
QUOTE(barry123 @ Jul 5 2007, 07:54) *

I want the same but when I sort to most played it shows me the first click from low to high number.
I have to hit twice to go from high number to low.
It's kind of annoying when there are 1000 songs in my playlist.
I guess it's because track number have to be from low to high, but I dont know how to change this.


Sort by: $sub(999,%playcount%)

QUOTE(barry123 @ Jul 5 2007, 07:54) *

question 2, how do you get the 0 before the numbers like:
01
I use this now:
display tab:
$if($strcmp(%PLAYCOUNT%,?),
0 times,
$if($strcmp(%PLAYCOUNT%,1),
%PLAYCOUNT% time,
%PLAYCOUNT% times
))

sort tab:
$num(%PLAYCOUNT%,100)


A simpler Code would be:
CODE

$num(%playcount%,2) time$ifgreater(%playcount%,1,s,)

Also, your sort code makes no sense. Use the one i have put above.
barry123
thanks works fine but it shows 00 time now.

It will be nice to see songs never played like "not played yet" or something.

I tried:
$num(%playcount%,2)
$ifequal(%playcount%,0,never,)
$ifequal(%playcount%,1,time,)
$ifgreater(%playcount%,1,times,)

output
00 never (00 is wrong)
01 time
02 times
kanak
Use this code:

CODE

$if(%play_count%,
$num(%playcount%,2) time$ifgreater(%playcount%,1,s,),
Not Played Yet)


-- Moderation: Removed redundant quote of the preceding post.
barry123
Thank you kanak.

QUOTE(kanak @ Jul 5 2007, 18:10) *

QUOTE(barry123 @ Jul 5 2007, 07:54) *

I want the same but when I sort to most played it shows me the first click from low to high number.
I have to hit twice to go from high number to low.
It's kind of annoying when there are 1000 songs in my playlist.
I guess it's because track number have to be from low to high, but I dont know how to change this.


Sort by: $sub(999,%playcount%)



almost forgotten.
is there something similar for lastplayed?

I made this:

display tab
CODE

// Last played
$puts(lp_year,$substr(%lastplayed%,1,4))
$puts(lp_month,$substr(%lastplayed%,6,7))
$puts(lp_day,$substr(%lastplayed%,9,10))
$puts(lp_hour,$substr(%lastplayed%,12,13))
$puts(lp_min,$substr(%lastplayed%,15,16))

$if(%lastplayed%,$get(lp_day)-$get(lp_month)-$get(lp_year)'  '$get(lp_hour):$get(lp_min))


sort tab:
CODE

$sub(999,%lastplayed%)

// Last played
$puts(lp_year,$substr(%lastplayed%,1,4))
$puts(lp_month,$substr(%lastplayed%,6,7))
$puts(lp_day,$substr(%lastplayed%,9,10))
$puts(lp_hour,$substr(%lastplayed%,12,13))
$puts(lp_min,$substr(%lastplayed%,15,16))

$if(%lastplayed%,$get(lp_year)-$get(lp_month)-$get(lp_day)' - '$get(lp_hour):$get(lp_min))


$sub(999,%lastplayed%) helps a little bit.
without, it shows just like playcounter did without it.
from never been played to first played and so on to the bottem of the page with the latest played


when I add it to my sort tab it goes like:
from first played to last played and then the never been played.

what I want is from Latest played to first played en after that the never been played.
kanak
You can use cwb_hooks to do the same thing in an easier way. Get the component Here

Next, use this code:
CODE

$sub(999,$cwb_datediff(%lastplayed%,%cwb_systemdatetime%))


The $sub part subtracts from 999 to get the latest first. If you want the first listened to tracks to appear first, you can remove the $sub(999,) part
barry123
I tried what you say.

what I see is:
2007-07-04 11:45
2007-07-04 11:46
2007-07-04 11:47
etc. etc.

then all my 'never been played'

2007-07-05 10:01
2007-07-05 11:04
2007-07-05 11:06
etc. etc.

as soon as I remove the
$sub(999,$cwb_datediff(%lastplayed%,%cwb_systemdatetime%))
everything is showed well, but on the bottem the lastest played.
kanak
I'm sorry i made a mistake in the code.

try:

$sub(%cwb_systemdatetime%,%lastplayed%)
barry123
I'm sorry.
goes like:
first to latest played and then the never been played.
kanak
This is strange. I tried the same sort string in my playlist, and it does sort correctly. In your case, the sort string is disregarding the hh:mm:ss part, which does not happen in my case. Which components are you using?


-- Moderation: Removed redundant quote of the preceding post.
barry123
foo_playback_custom.dll
Playback Statistics Custom 1.0.1

which one you so I can test that one as well?


-- Moderation: Removed redundant quote of the preceding post.
kanak
I'm using Foobar Official Play Count plugin (latest) with CWB hooks (latest). I've set the play count plugin to write to files.


-- Moderation: Removed redundant quote of the preceding post.
tjordan90
If you're looking to create a "Recently played" smart playlist (autoplaylist, Playlist tree, whatever), and sort from most recent (at the top) to oldest (at the bottom) (descending order), the following string can be used in your sort column.

CODE
$replace(%last_played%,'-',,':',,' ',)


If you're using Playlist Tree, you can just check "Reverse". If you're using autoplaylist, you can use some subtraction. E.g.
CODE
$sub(99999999999999,$replace(%last_played%,'-',,':',,' ',))
.

I can't take credit for that one; I believe someone on this board posted it before, but thought I'd just pass it along since it was something that irked me for a long time.

I'm using foo_playcount 1.3.1 BTW.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.