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: Play Counter (Read 340843 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Play Counter

Reply #175
Quote
Are you sure that it's not possible to alter the db and not the tags? There's a "DB Only Mask" checkbox in the plugins config page, which suggests it is possible -)
[a href="index.php?act=findpost&pid=269260"][{POST_SNAPBACK}][/a]

no, it's not. you are confusing two things:

afaik foobar's api makes it possible to prevent tag changes from being written to files at the moment of change (db_only flag in appropriate routines). this info has no effect later on (i.e. it's not being remembered), so these changes could get written to files sooner or later.

'Block tag update operations' option would prevent any writing to files ...

Play Counter

Reply #176
Quote
Alternatively, you can use kode54's version instead, as it uses an external database.
[a href="index.php?act=findpost&pid=269237"][{POST_SNAPBACK}][/a]

Where can I find that version? I think an external database would be the best solution to the problem.

 

Play Counter

Reply #177
Quote
Quote
Alternatively, you can use kode54's version instead, as it uses an external database.
[{POST_SNAPBACK}][/a]

Where can I find that version? I think an external database would be the best solution to the problem.
[a href="index.php?act=findpost&pid=269378"][{POST_SNAPBACK}][/a]


[a href="http://www.saunalahti.fi/cse/kode54/foo_playcount.zip]*bo[/url]om*

Now with rather limited support for either sqlite.dll (only my included version) or libmysql.dll, and thanks to my messy coding, no longer depends on pmysql, but still uses PTypes for some very minor crap because I am lazy.

Play Counter

Reply #178
Quote
Quote
Are you sure that it's not possible to alter the db and not the tags? There's a "DB Only Mask" checkbox in the plugins config page, which suggests it is possible -)
[a href="index.php?act=findpost&pid=269260"][{POST_SNAPBACK}][/a]

no, it's not. you are confusing two things:

afaik foobar's api makes it possible to prevent tag changes from being written to files at the moment of change (db_only flag in appropriate routines). this info has no effect later on (i.e. it's not being remembered), so these changes could get written to files sooner or later.

'Block tag update operations' option would prevent any writing to files ...
[a href="index.php?act=findpost&pid=269373"][{POST_SNAPBACK}][/a]


I'm not sure what you mean by this, but I've added all my file types to the "DB Only" config option and it works. All the play count tags are stored in the database and my files remain untouched. I don't have "block tag operations" enabled.

Play Counter

Reply #179
Quote
I'm not sure what you mean by this, but I've added all my file types to the "DB Only" config option and it works. All the play count tags are stored in the database and my files remain untouched. I don't have "block tag operations" enabled.
[a href="index.php?act=findpost&pid=269403"][{POST_SNAPBACK}][/a]

I think that when you will update/change your tag files i.e. Artist or whatever, the playcount tags will get tagged into the file. You could try to check it just by open properties of a file that has the playcount tags (that are not written intot he file because you have the 'DB only' option), change a tag (artist or whatever) and hit update file. See if the file has been tagged with playcounter tags 

Play Counter

Reply #180
Quote
Here is the format I used, I added the time stamp to the code that tboehrer provided.



Code: [Select]
$if(%play_date%,' '$substr(%play_date%,3,4)
|$left(%play_date%,2)|$right(%play_date%,2)' @ '
$left(%play_time%,2):$substr(%play_time%,3,4),
'                 ')

Code: [Select]
The output looks like this at the end of my playlist:
04|13|04 @ 19:33

[a href="index.php?act=findpost&pid=202907"][{POST_SNAPBACK}][/a]


for anyone in australia or england or anywhere else that uses the other way of date formatting i have this currently working in my track info panel

Code: [Select]
This song was played %play_counter% times so far. 
$char(10)
Last played:
$if(%play_date%,' '$left(%play_date%,2)|$substr(%play_date%,3,4)|$right(%play_date%,2)' @ '
$left(%play_time%,2):$substr(%play_time%,3,4),
'                 ')


this swaps the months and the days around to my preferred way

Play Counter

Reply #181
Here is the code I use.

Code: [Select]
$if(%play_counter%,$get(bleu)Ce morceau a été joué %play_counter%$get(bleu) fois.
$char(10)$get(bleu)Dernière lecture



$puts(total,$add($right(%play_date%,2),$select($substr(%play_date%,3,4),    $if($strcmp($left(%play_date%,2),04),0,1),$if($strcmp($left(%play_date%,2),04),3,4),4,0,2,5,0,3,6,1,4,6),6,$left(%play_date%,2)))
$select($add(1,$mod($add($get(total),$div($left(%play_date%,2),4)),7)),Samedi,Dimanche,Lundi,Mardi,Mercredi,Jeudi,Vendredi)


$num($right(%play_date%,2),1)$if($strcmp($right(%play_date%,2),01),er) $select($substr(%play_date%,3,4),Janvier,Février,Mars,Avril,Mai,Juin,Juillet,Août,Septembre,Octobre,Novembre,Décembre) 20$left(%play_date%,2)$char(10)
                       $get(bleu)à $left(%play_time%,2):$right($left(%play_time%,4),2)
,$get(bleu)Ce morceau n''a jamais été joué)

The date is sored this way : %y%M%D
And the time : $H$M$S

The advantage of storing this way is that I can easily sort according to the date (and hour) when tracks were played

And the date is displayed this way :
Dernière lecture Vendredi 4 Février 2005 à 16:40

It's in French but translation shouldn't be a problem :
Janvier : January, etc...
Samedi : Saturday etc...
Dernière lecture : last time played
Ce morceau n''a jamais été joué : never played

Play Counter

Reply #182
Quote
Here is the code I use.

Code: [Select]
$if(%play_counter%,$get(bleu)Ce morceau a été joué %play_counter%$get(bleu) fois.
$char(10)$get(bleu)Dernière lecture



$puts(total,$add($right(%play_date%,2),$select($substr(%play_date%,3,4),    $if($strcmp($left(%play_date%,2),04),0,1),$if($strcmp($left(%play_date%,2),04),3,4),4,0,2,5,0,3,6,1,4,6),6,$left(%play_date%,2)))
$select($add(1,$mod($add($get(total),$div($left(%play_date%,2),4)),7)),Samedi,Dimanche,Lundi,Mardi,Mercredi,Jeudi,Vendredi)


$num($right(%play_date%,2),1)$if($strcmp($right(%play_date%,2),01),er) $select($substr(%play_date%,3,4),Janvier,Février,Mars,Avril,Mai,Juin,Juillet,Août,Septembre,Octobre,Novembre,Décembre) 20$left(%play_date%,2)$char(10)
                       $get(bleu)à $left(%play_time%,2):$right($left(%play_time%,4),2)
,$get(bleu)Ce morceau n''a jamais été joué)

The date is sored this way : %y%M%D
And the time : $H$M$S

The advantage of storing this way is that I can easily sort according to the date (and hour) when tracks were played

And the date is displayed this way :
Dernière lecture Vendredi 4 Février 2005 à 16:40

It's in French but translation shouldn't be a problem :
Janvier : January, etc...
Samedi : Saturday etc...
Dernière lecture : last time played
Ce morceau n''a jamais été joué : never played
[a href="index.php?act=findpost&pid=270908"][{POST_SNAPBACK}][/a]



wow very nice idea indeed, are you using this in your columns or in your track info ?

i would love to be able to sort my colums by most frequently played or last played...

i hope that makes sense

Play Counter

Reply #183
Code: [Select]
$char(10)
$if(%play_counter%,$get(bleu)This song has been played %play_counter%$get(bleu) times.
$char(10)$get(bleu)Last Played



$puts(total,$add($right(%play_date%,2),$select($substr(%play_date%,3,4), $if($strcmp($left(%play_date%,2),04),0,1),$if($strcmp($left(%play_date%,2),04),3,4),4,0,2,5,0,3,6,1,4,6),6,$left(%play_date%,2)))
$select($add(1,$mod($add($get(total),$div($left(%play_date%,2),4)),7)),Saturday,Sunday,Monday,Tuesday,Wednesday,Thursday,Friday)


$num($right(%play_date%,2),1)$if($strcmp($right(%play_date%,2),01),er) $select($substr(%play_date%,3,4),January,February,March,April,May,June,July,August,September,October,November,December) 20$left(%play_date%,2)$get(bleu) at $left(%play_time%,2):$right($left(%play_time%,4),2)
,$get(bleu)Thisis your first time listening to this song.)


here is the translated,

can you tell me what bleu is for?

also i would like to have if the song has only been played once, then instead of it saying this song has been played 1 times it says 1 time. ie singular instead of plural.


also for the daye i would like to have it be on the actual day be 1st, 2nd, 3rd, 4th etc instead of 1,2,3,4

hope you can understand that?

thanks

Play Counter

Reply #184
Quote
wow very nice idea indeed, are you using this in your columns or in your track info ?

i would love to be able to sort my colums by most frequently played or last played...

i hope that makes sense
[a href="index.php?act=findpost&pid=271006"][{POST_SNAPBACK}][/a]
I use this in my track info panel

You can easily create a colum with this info, though you dont need one to sort by last played : just select all your playlist (or double clic on status bar) and then sort>sort by> %play_date%, or even better : %play_date% %play_time%

The advantage of having a dedicated column is that this can be done in just one clic 

Play Counter

Reply #185
Quote
Code: [Select]
$char(10)
$if(%play_counter%,$get(bleu)This song has been played %play_counter%$get(bleu) time$if($greater(%play_counter%,1),s).
$char(10)$get(bleu)Last Played



$puts(total,$add($right(%play_date%,2),$select($substr(%play_date%,3,4), $if($strcmp($left(%play_date%,2),04),0,1),$if($strcmp($left(%play_date%,2),04),3,4),4,0,2,5,0,3,6,1,4,6),6,$left(%play_date%,2)))
$select($add(1,$mod($add($get(total),$div($left(%play_date%,2),4)),7)),Saturday,Sunday,Monday,Tuesday,Wednesday,Thursday,Friday)


 $num($right(%play_date%,2),1)
$select($right(%play_date%,2),st,nd,rd,th,th,th,th,th,th,th,th,th,th,th,th,th,th,th,th,th,st,nd,rd,th,th,th,th,th,th,th,st)
$select($substr(%play_date%,3,4),January,February,March,April,May,June,July,August,September,October,November,December) 20$left(%play_date%,2)$get(bleu) at $left(%play_time%,2):$right($left(%play_time%,4),2)
,$get(bleu)This is your first time listening to this song.)


here is the translated,

can you tell me what bleu is for?

also i would like to have if the song has only been played once, then instead of it saying this song has been played 1 times it says 1 time. ie singular instead of plural.


also for the daye i would like to have it be on the actual day be 1st, 2nd, 3rd, 4th etc instead of 1,2,3,4

hope you can understand that?

thanks
[a href="index.php?act=findpost&pid=271008"][{POST_SNAPBACK}][/a]

This should work
"bleu" is just a color, I have "$puts(bleu,918377)" at the begining of the panel, but you can put whatever color you want (bleu means blue in French)

Ooops, this will put you 31th ... Well, let's be "bestial"

Play Counter

Reply #186
very nice indeed thankyou very much

Play Counter

Reply #187
can anyone format this
Code: [Select]
$if(%play_counter%,$get(info)Last Played: $get(text) $puts(total,$add($right(%play_date%,2),$select($substr(%play_date%,3,4), $if($strcmp($left(%play_date%,2),04),0,1),$if($strcmp($left(%play_date%,2),04),3,4),4,0,2,5,0,3,6,1,4,6),6,$left(%play_date%,2)))
$select($add(1,$mod($add($get(total),$div($left(%play_date%,2),4)),7)),Saturday,Sunday,Monday,Tuesday,Wednesday,Thursday,Friday) $num($right(%play_date%,2),1)$if($strcmp($right(%play_date%,2),01),er) $select($substr(%play_date%,3,4),January,February,March,April,May,June,July,August,September,October,November,December) 20$left(%play_date%,2) at $left(%play_time%,2):$right($left(%play_time%,4),2)
,$get(info)This is your first time listening to this song.)$char(10)

To show AM PM as well?
Thanks

Play Counter

Reply #188
Quote
can anyone format this
Code: [Select]
$if(%play_counter%,$get(info)Last Played: $get(text) $puts(total,$add($right(%play_date%,2),$select($substr(%play_date%,3,4), $if($strcmp($left(%play_date%,2),04),0,1),$if($strcmp($left(%play_date%,2),04),3,4),4,0,2,5,0,3,6,1,4,6),6,$left(%play_date%,2)))
$select($add(1,$mod($add($get(total),$div($left(%play_date%,2),4)),7)),Saturday,Sunday,Monday,Tuesday,Wednesday,Thursday,Friday) $num($right(%play_date%,2),1)$if($strcmp($right(%play_date%,2),01),er) $select($substr(%play_date%,3,4),January,February,March,April,May,June,July,August,September,October,November,December) 20$left(%play_date%,2) at $left(%play_time%,2):$right($left(%play_time%,4),2)
,$get(info)This is your first time listening to this song.)$char(10)

To show AM PM as well?
Thanks
[a href="index.php?act=findpost&pid=271514"][{POST_SNAPBACK}][/a]

I copied this into my columns, it looks good, however, the year is displayed as 2011, 2018, or sometime in the future.     
I should be grateful if you could correct the year for me.

Play Counter

Reply #189
just noticed happens with mine too

Play Counter

Reply #190
Because he might be using %y%M%D for PLAY_DATE, eg today is 050208.
Edit: As for AM/PM, it seems to me that at least one or two peeps have already posted their method in the track info pannel topic or somewhere near

Play Counter

Reply #191
Quote
can anyone format this
Code: [Select]
$if(%play_counter%,$get(info)Last Played: $get(text) $puts(total,$add($right(%play_date%,2),$select($substr(%play_date%,3,4), $if($strcmp($left(%play_date%,2),04),0,1),$if($strcmp($left(%play_date%,2),04),3,4),4,0,2,5,0,3,6,1,4,6),6,$left(%play_date%,2)))
$select($add(1,$mod($add($get(total),$div($left(%play_date%,2),4)),7)),Saturday,Sunday,Monday,Tuesday,Wednesday,Thursday,Friday) $num($right(%play_date%,2),1)$if($strcmp($right(%play_date%,2),01),er) $select($substr(%play_date%,3,4),January,February,March,April,May,June,July,August,September,October,November,December) 20$left(%play_date%,2) at $left(%play_time%,2):$right($left(%play_time%,4),2)
,$get(info)This is your first time listening to this song.)$char(10)

To show AM PM as well?
Thanks
[a href="index.php?act=findpost&pid=271514"][{POST_SNAPBACK}][/a]


Where do the "info" and "text" variables come from?

Play Counter

Reply #192
juet formatting strings

Play Counter

Reply #193
I think I fixed the improper display thing
Code: [Select]
$if(%play_counter%,$get(info)Last Played: $get(text) $puts(total,$add($left(%play_date%,2),$select($left(%play_date%,2), $if($strcmp($substr(%play_date%,3,4),04),0,1),$if($strcmp($left(%play_date%,2),04),3,4),4,0,2,5,0,3,6,1,4,6),6,$substr(%play_date%,3,4)))
$select($add(1,$mod($add($get(total),$div($substr(%play_date%,3,4),4)),7)),Saturday,Sunday,Monday,Tuesday,Wednesday,Thursday,Friday) $num($left(%play_date%,2),1)$if($strcmp($right(%play_date%,2),01),er) $select($substr(%play_date%,3,4),January,February,March,April,May,June,July,August,September,October,November,December) $right(%play_date%,4) at $left(%play_time%,2):$right($left(%play_time%,4),2)
,$get(info)This is your first time listening to this song.)$char(10)


Can someone tell me what is the default format used "%D%M%Y" or "%M%D%Y"


Now to do AM PM thingy

Play Counter

Reply #194
Quote
Can someone tell me what is the default format used "%D%M%Y" or "%M%D%Y"


The default is %D%M%y.

I use %Y%M%D$H$M$S.  This gives a combined date + time and allows sorting by last played.
Santa is very jolly because he knows where all the bad girls live.  - Dennis Miller

Play Counter

Reply #195
Has someone done the AM/PM thing using %play_time% couldnt find in this thread

Play Counter

Reply #196
This is a section of the code I use in my Track Info panel:
Code: [Select]
$puts(Last_played,$select(1,
$if($meta_test(PLAY_DATE),
$puts(month,$select($substr($meta(PLAY_DATE),3,4),
'January','February','March','April','May','June','July','August','September','October','November','December',))
$left($meta(PLAY_DATE),2)' '$get(month)' 20'$right($meta(PLAY_DATE),2)', '
),$meta(PLAY_DATE))

$if([$meta(PLAY_TIME)],
$ifgreater($meta(PLAY_TIME),130000,$sub($substr($meta(PLAY_TIME),1,2),12),$ifgreater(1,$substr($meta(PLAY_TIME),1,2),'12',$substr($meta(PLAY_TIME),1,2)))':'$substr($meta(PLAY_TIME),3,4)
//':'$substr($meta(PLAY_TIME),5,6)
$ifgreater($meta(PLAY_TIME),120000,' pm',' am'),'Never'
)
)


Remove the '//' if you want seconds too

Play Counter

Reply #197
thanks a lot crazy

Play Counter

Reply #198
tboehrer:

please give this thread a read and drop in your opinion:
http://www.hydrogenaudio.org/forums/index....showtopic=31530

From looking at the sources, it seems quite easy to change the default to the proposed standard in the above thread. But i guess it would be a better idea (if you want to) when you would officially change the default instead of someone else changing the source and compiling it.

- Lxc
I am arrogant and I can afford it because I deliver.

Play Counter

Reply #199
Quote
Quote
Quote
Alternatively, you can use kode54's version instead, as it uses an external database.
[{POST_SNAPBACK}][/a]

Where can I find that version? I think an external database would be the best solution to the problem.
[a href="index.php?act=findpost&pid=269378"][{POST_SNAPBACK}][/a]


[a href="http://www.saunalahti.fi/cse/kode54/foo_playcount.zip]*bo[/url]om*

Now with rather limited support for either sqlite.dll (only my included version) or libmysql.dll, and thanks to my messy coding, no longer depends on pmysql, but still uses PTypes for some very minor crap because I am lazy.
[a href="index.php?act=findpost&pid=269381"][{POST_SNAPBACK}][/a]


Is this incompatible with mysql under 4.1.x ? I cannot use it with mysql 4.0.23....
I receive the following error when hitting the create tavle button:



please, any guidance would be appreciated.