Help - Search - Members - Calendar
Full Version: Play Counter
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
kode54
Apparently, it is. Either update the server, or use SQLite.
beto
QUOTE(kode54 @ Feb 21 2005, 05:13 AM)
Apparently, it is. Either update the server, or use SQLite.
*



Server update is not feasible ATM because I run other databases that still cannot be converted to 4.1, due to lack of proper php4 support in windows...

Will give sqlite a shot.

thanks for the info.
beto
Can't make it work with SQLite either... I always get this crash. when hitting the button test.

Is there any readme/tutorial on installing this plugin with sqlite?

If anyone could help me I would appreciate.
beto
@kode54
I know that you are a busy man and one of the most savvy plugin developers here at HA and sorry for insisting in this issue, but I really am having a hard time doing this work with sqlite...

I am really interested, but so far I had no success.

I would appreciate a small tutorial (for the sqlite total noob) from you or from any other person that successfully achieved playcount working with sqlite...

thanks again
dano
beto have you put the sqlite.dll in the foobar2000 dir (same location as foobar2000.exe) and not the components dir? basically that's all you need...
and ofc kode54's foo_playcount.dll in the components dir
beto
thanks. now it's working.
kode54
Yeah, sorry, maybe I should include a readme. smile.gif
jkwarras
kode54, your version works great thanks you. Now I can safely use playcounts without touching my files smile.gif

Wouldn't be better if this version were on the components database and/or be available on the first page of this thread or it's own thread? It's really hard to find it (unless you're really looking for it), ad I think it's does what a lot of users wants: add playcount without tagging the file. I'm sure a lot of users will use this component instead of the original one if they knew it exist and it's so damn easy to install (because when you see that you need SQL stuff, blabla it scares a lot of people (like me the first time) that think you have to install the whole SQL stuff).

Some questions comes to my mind:

- It's this multi-users aware? I mean, does it store my counts separetly for different users accounts?
- Can I reset the playcounts?
- Where is the info stored, in the sqlite.dll file (sorry if I'm dumb smile.gif )?
- I guess it could be great if we could have a append function, I mean as requested by someone around here, keep track of everytime a file has been played, as it would allow stuff like 'top played last month' etc...
- And could this approach (store info in SQlite) be implemented in another plugins like rating, etc...)? Because that woud be great to be able to store personal info in a external database, yum.... cool.gif (i.e. if someone would be interested in making foo_quicktag use sqlite.dll...)

BTW, would you be interested in implementing thisthis?
It'll be as simple as setting last_played field as default with the following format %Y-%m-%d %H:%M:%S.
Edit: Sorry, not so simple because it also needs to implement a first_played field.

Thanks in advance.
beto
Sorry, but I think I precipitated myself... Apparently my noobness has no limits tongue.gif

Apparently the sqlite DB is being accessed successfully, nevetheless I cannot see any playcount information in my playlists. Do I need a special plugin/script of some sort to extract this information to the playlists (with the regular playcount plugin it works flawlessly)?

Another thing: what does the Resync button do?

Thank you again!!
dano
To check if sqlite updates playcounts, you can check the file modification date of the the new "playcount.db" file in the foobar2000 dir or just in the file properties (Technical info).
And you must use %__play_counter% instead of %_play_counter%
also discussed here
beto
thank you very much dano.
jkwarras
QUOTE(jkwarras @ Feb 23 2005, 02:38 AM)
- Where is the info stored, in the sqlite.dll file (sorry if I'm dumb  smile.gif )?
*


QUOTE(dano)
you can check the file modification date of the the new "playcount.db" file in the foobar2000 dir or just in the file properties (Technical info).

Ok, now I know that I'm really dumb laugh.gif
beto
To summarize (and help others that may bump into the same problems I had):

Playcount with SQLite how to

1. Get the playcount plugin with SQLite support from kode54's page here.
2. Extract foo_playcount.dll to the components directory and SQLite.dll to foobar's root directory
3. Start foobar
4. Configure the playcount plugin to use SQLite in the preferences dialog

To access the playcount information treat the playcount "tags" as technical fields, ie, use %__play_time% instead of %_play_time% in your scripts.

Thanks again for the always precise help of users and developers of this forum.
jkwarras
@kode54:

I've noticed that if I load properties (under fb2k) and I hit 'reload info from file' the playcount and playtime dissapears. If I close and reload again it's still there but if I hit 'reload info from file' and then 'update info' all the playcount info dissapears and if I close and reload it's not there anymore. It's this intended or normal behaviour?

BTW, does someone knows how can I transfer my playcounts from %play_counter% to %__play_counter%? I can do it the other way ( from %__play_counter% to %play_counter%) via masstagger but doesn't work the other way or I don't know how to do it unsure.gif
Killmaster
Everything in the play count prefs is greyed out, and it's adding a play_stamp field (as suggested earlier in this thread) but its not recognizing all the variables.

Here's what I mean:

PLAY_STAMP = 2005-12-T$H:$M:$S$T

It recognizes year and month, but nothing else. Also, is there a way to erase certain entries in the database or anything?
gob
this sql plugin sounds great. if only there was a way to get the ratings into it.
also, with this plugin, how does it associate tags with the songs? does it go by path? is it possible to move files to different directories and retain thier entry in the sql db?
jkwarras
QUOTE(Killmaster @ Feb 24 2005, 08:38 PM)
PLAY_STAMP = 2005-12-T$H:$M:$S$T

It recognizes year and month, but nothing else.
*


If you hit 'help' you'll get into this MS information page that explain all the variables that you can use in this plugin. This mod version uses that code instead of the code from default foo_playcount version.

Here's the code that you can use in the optional fields:
CODE

%a
Abbreviated weekday name
%A
Full weekday name
%b
Abbreviated month name
%B
Full month name
%c
Date and time representation appropriate for locale
%d
Day of month as decimal number (01 – 31)
%H
Hour in 24-hour format (00 – 23)
%I
Hour in 12-hour format (01 – 12)
%j
Day of year as decimal number (001 – 366)
%m
Month as decimal number (01 – 12)
%M
Minute as decimal number (00 – 59)
%p
Current locale's A.M./P.M. indicator for 12-hour clock
%S
Second as decimal number (00 – 59)
%U
Week of year as decimal number, with Sunday as first day of week (00 – 53)
%w
Weekday as decimal number (0 – 6; Sunday is 0)
%W
Week of year as decimal number, with Monday as first day of week (00 – 53)
%x
Date representation for current locale
%X
Time representation for current locale
%y
Year without century, as decimal number (00 – 99)
%Y
Year with century, as decimal number
%z, %Z
Either the time-zone name or time zone abbreviation, depending on registry settings; no characters if time zone is unknown
%%
Percent sign



For your tag you'll need to use this:

CODE
play_stamp=%Y-%m-%d %H:%M:%S

...which is the equivalent to
CODE
play_stamp=%Y-%M-%D $H:$M:$S

...in the default version.

BTW, I suggest to to take a look at this threadthread, where the new recommended playcount stamp tag is %last_played% (is the one that developpers will support in future components).
So your code should be:
CODE
last_played%=%Y-%M-%D $H:$M:$S


Hope that helps ph34r.gif
jkwarras
QUOTE(gob @ Feb 24 2005, 09:49 PM)
this sql plugin sounds great. if only there was a way to get the ratings into it.
*


I hope that some developper will get interested in implementing my request rolleyes.gif
jkwarras
QUOTE(jkwarras @ Feb 23 2005, 08:15 AM)
BTW, does someone knows how can I transfer my playcounts from %play_counter% to %__play_counter%? I can do it the other way ( from %__play_counter% to %play_counter%) via masstagger but doesn't work the other way or I don't know how to do it  unsure.gif
*


So I guess it's not possible.... crying.gif
foosion
QUOTE(jkwarras @ Feb 25 2005, 01:39 PM)
So I guess it's not possible....  crying.gif
*
Correct.
jkwarras
QUOTE(foosion @ Feb 25 2005, 04:48 AM)
QUOTE(jkwarras @ Feb 25 2005, 01:39 PM)
So I guess it's not possible....  crying.gif
*
Correct.
*


kode54, could it be possible for you to add an option to transfer playcounts from %play_counter% to %__play_counter%? (as well as the other playcount fields?). Thanks.
banjobacon
QUOTE(jkwarras @ Feb 25 2005, 12:31 AM)
So your code should be:
CODE
last_played%=%Y-%M-%D $H:$M:$S


Hope that helps ph34r.gif
*



Don't you mean...

CODE
last_played%=%Y-%m-%d %H:%M:%S


...?

EDIT: Lowered the case on a couple of letters.
Killmaster
QUOTE(jkwarras @ Feb 25 2005, 08:23 AM)
QUOTE(foosion @ Feb 25 2005, 04:48 AM)
QUOTE(jkwarras @ Feb 25 2005, 01:39 PM)
So I guess it's not possible....  crying.gif
*
Correct.
*


kode54, could it be possible for you to add an option to transfer playcounts from %play_counter% to %__play_counter%? (as well as the other playcount fields?). Thanks.
*




Well, I got it all set up nicely now.. merging the two tags with TAGZ is really quite simple, what I did was use $puts(lastPlayed,$if2(%__last_played%,%last_played%)) and then replaced everything with $get(lastPlayed).. playcounts are also pretty simple, just use $add(%__play_counter%,%play_counter%).
Lyx
QUOTE(banjobacon @ Feb 25 2005, 10:41 PM)
Don't you mean...

CODE
last_played%=%Y-%m-%d %H:%M:%S


...?
*



There is also a missing % at the beginning.
jkwarras
QUOTE(banjobacon @ Feb 25 2005, 12:41 PM)
Don't you mean...

CODE
last_played%=%Y-%m-%d %H:%M:%S

*


Ups, yes, sorry... blush.gif
jkwarras
QUOTE(Killmaster @ Feb 25 2005, 01:39 PM)
Well, I got it all set up nicely now.. merging the two tags with TAGZ is really quite simple, what I did was use $puts(lastPlayed,$if2(%__last_played%,%last_played%)) and then replaced everything with $get(lastPlayed).. playcounts are also pretty simple, just use $add(%__play_counter%,%play_counter%).
*


Thanks, but this works only to display the sum of all both values if present. But what I want is to transfer count from %play_count% tag to %__play_count% metadata so I can erase %play_count% tags. (idem for %last_played%)
Aero
jkwarras asked me to take a look at Kode54's version of foo_playcount to see if I could make my foo_pod iPod component work with this to synchronize play counts/dates without writing metadata to the original files.

I followed the same basic steps posted here (although I don't have an option to choose which database to use...persumably because I only have sqlite.dll installed). I am able to test that SQLite is working correctly, which creates the playcount.db file. But the database file is never created if I don't do Test, and it is never written to as a result of normal file playback.

Are there any other settings that I need to look at in order to make this component work?


Also, I was briefly looking over the source, and it looks like it might not work as is with foo_pod. foo_pod will need to sum the play counts from foo_playcount with those from the iPod, but it looks like foo_playcounter is only set up to store play counts that it has detected (via play_callback). In particular, I think there will need to be an implementation for metadb_callback::on_info_edited() that stores the edited value to the database.
Killmaster
QUOTE(jkwarras @ Feb 25 2005, 02:19 PM)
QUOTE(Killmaster @ Feb 25 2005, 01:39 PM)
Well, I got it all set up nicely now.. merging the two tags with TAGZ is really quite simple, what I did was use $puts(lastPlayed,$if2(%__last_played%,%last_played%)) and then replaced everything with $get(lastPlayed).. playcounts are also pretty simple, just use $add(%__play_counter%,%play_counter%).
*


Thanks, but this works only to display the sum of all both values if present. But what I want is to transfer count from %play_count% tag to %__play_count% metadata so I can erase %play_count% tags. (idem for %last_played%)
*


Obviously, that would be the ideal situation.. for now though, it keeps Foobar from making any additional changes to the files, which is nice for certain file sharing programs that keep changing the hash everytime I play a song smile.gif
jkwarras
QUOTE(Aero @ Feb 26 2005, 02:15 PM)
But the database file is never created if I don't do Test, and it is never written to as a result of normal file playback.
*


Normally you shoudl be seeing a play_counter entry in the metadata (right side in properties window, in teh same place as replaygain values, etc...). if this is not there something is going wrong, but I don't know what....
beto
QUOTE(beto @ Feb 21 2005, 10:49 AM)
QUOTE(kode54 @ Feb 21 2005, 05:13 AM)
Apparently, it is. Either update the server, or use SQLite.
*



Server update is not feasible ATM because I run other databases that still cannot be converted to 4.1, due to lack of proper php4 support in windows...

Will give sqlite a shot.

thanks for the info.
*



Finally I updated my Mysql installation and got the playcount plugin working. However I am getting strange characters in the URL field. See here.

Apparently it is a UTF-8 issue related to portuguese characters, but I am unable to solve it.

I am using the utf8_unicode_ci collation in this database, if this helps.

Does anyone (kode54?) know how to solve this??

Many thanks
jkwarras
I'm using playcount mod version (kode54) and everything was working fine, but yesterday I was setting the fb2k of another user on the same pc (multiple user enabled in fb2k) and I copied my playcount.db file in the other user appropiate folder (so he doesn't start at 0), then I resync in preferences and all playcounts appear as expected. Then switching to my fb2k I noticed today that my tracks are showing the right playcounts but when I play a track the playcount restart at 0 (i.e. a track with 10 playcounts gets a 1 instead of 11).

Someone knows what can be going on? huh.gif

Thanks.
edm107
Can anyone tell me how this playcount with external DB work?.. i have install the plugin but i don't know how to use. The "CREATE TABLE" button is not available (I don't know why).. only "RESYNC" & "TEST" buttons are available.
Please help me to fix that! Thank you!
beto
read the thread. recently i put a small tutorial to make it work with sqlite...

see here:

http://www.hydrogenaudio.org/forums/index....ndpost&p=276290



edit: added link
drbeachboy
I wanted to let kode know that there is a problem updating tags in flac files with embedded cuesheets. It is making foobar2000 v0.8.3 crash, by hanging after clicking the "Update" button. Actually, it was a "Not Responding". It is also happening with "foo_quicktag_sql_1.0", as well. Could the sqlite.dll be causing a conflict? Also, I tried running each separately, but still the same problem. Removing them cleared the problem right up.
fabiospark
I read the Beto tut but after downloading and copying I have the commands in the config all greyed out. I checked and I'm sure I have sqlite.dll in the foobar dir and the foo_playcount in the component dir.

Is there a way to unlock the thing?

Thanks


Edit:

I played a track, closed and opened FB a couple of times and now "test" and resync" are not grayed out any more. I clicked on test and then went to see in the dir: now there is that playcount.db that was missing.
Now i'll do some testing to see if everything is OK.

drbeachboy
QUOTE(fabiospark @ Mar 28 2005, 11:17 AM)
I read the Beto tut but after downloading and copying I have the commands in the config all greyed up. I checked and I'm sure I have sqlite.dll in the foobar dir and the foo_playcount in the component dir.

Is there a way to unlock the thing?

Thanks
*


Try closing, then re-starting foobar2000. Press Re-sync and you should be good to go.
fabiospark
QUOTE(drbeachboy @ Mar 28 2005, 06:22 PM)
QUOTE(fabiospark @ Mar 28 2005, 11:17 AM)
I read the Beto tut but after downloading and copying I have the commands in the config all greyed up. I checked and I'm sure I have sqlite.dll in the foobar dir and the foo_playcount in the component dir.

Is there a way to unlock the thing?

Thanks
*


Try closing, then re-starting foobar2000. Press Re-sync and you should be good to go.
*



Thank you for the reply: it seems to work.

At least on my test PC.

I did the same on the actual "jukebox" but I don't see it work.

The playcount.db is not updated.

Any hint? Or any other info needed?


Edit: don't ask me why but it started working on the other PC too.
I just reloaded all my tracks in one big playlist and now it's going. Boh!?!

WHat does the "resync" and "create table" do? Thanks.
drbeachboy
The "Create table" button has never not been ghosted, so I'm not sure why it is there. The "Test" button seems to create the ".db" file and "Resync" seems to set it up, and that's all I can tell you. Hopefully, the author can further clarify what's happening.
edm107
QUOTE(drbeachboy @ Mar 28 2005, 09:23 AM)
The "Create table" button has never not been ghosted, so I'm not sure why it is there. The "Test" button seems to create the ".db" file  and "Resync" seems to set it up, and that's all I can tell you. Hopefully, the author can further clarify what's happening.
*



Thank you!!
war59312
Hey,

Well I am trying to get Kode54 version to work.

I am using for play_date:

%D%M%y

Which is the default.

So I added this column but its not working as expected:

[$left(%__play_date%,2)-$substr(%__play_date%,3,4)-$right(%__play_date%,2)]

Like atm its showing:

32-05-05

And even __play_date by itself shows:

3205

And it keeps chaning when playing. Makes not since to me. Like the next time i played the song again it changed the 32 to 36. So wtf?

As the normal play count one worked fine before this and still does if I complete refert back.

Oddly enough __play_counter works as expected:

$if(%__play_counter%,
$repeat('0',$sub($len2(10),$len2(%__play_counter%)))%__play_counter%,00)

Also for the song under tech info it shows:

PLAY_TIME = $H$M$S
play_counter = 11
play_timestamp = 63248611159765
PLAY_DATE = 3905

So play_time is not working either. As it shows just $H$M$S like it says there. But see play_date is fine.

Any help would be great.

Finally figured it out.

For yours I have to use %m%d%d%y for some reason even though default for orgianl plug retruns the same result. Strange.

And I am getting this error when shutting down foobar.

Appears to be random atm. sad.gif

user posted image
war59312
QUOTE(jkwarras @ Mar 21 2005, 12:48 PM)
I'm using playcount mod version (kode54) and everything was working fine, but yesterday I was setting the fb2k of another user on the same pc (multiple user enabled in fb2k) and I copied my playcount.db file in the other user appropiate folder (so he doesn't start at 0), then I resync in preferences and all playcounts appear as expected. Then switching to my fb2k I noticed today that my tracks are showing the right playcounts but when I play a track the playcount restart at 0 (i.e. a track with 10 playcounts gets a 1 instead of 11).

Someone knows what can be going on?  huh.gif

Thanks.
*


Sure, here you go:

CODE


[$if(%__play_counter%,
$repeat('0',$sub($len2(10),$len2(%__play_counter%)))%__play_counter%,00)]



Does not show at all if not played at least once. So does not show up when listening to shoutcast either for example.

If played 1-9 it shows, 01-09 and more than 10 is like 10-99...

Does this work with more than 99, dont know? Sure u just change 10 to 100 or however many zero places u want I guess. Though doubt I will ever listen to a song more than 99 times so....

I personaly use 1 since never more than 9 times....so it shows 1-9 as 1-9 instead of 01-09....
krazy
QUOTE(war59312 @ Apr 9 2005, 10:39 AM)
And I am getting this error when shutting down foobar.

Appears to be random atm. sad.gif

user posted image
*


I'm also getting this. It disappears when I remove kode's playcount plugin. Anyone else getting/know how to get around this?
beto
I get this error all the time, but apparently nothing is being lost/impacted so I just don't pay attention.
krazy
It seems to stop foobar shutting down properly / updating the database.
I notice that foobar doesn't resume properly, and the playcount / last_played is not updated when re-opening foobar. I even had a corrupted .cfg the other day, but not sure if that can be attributed to playcount... ph34r.gif wink.gif
4nt1
i also get this error
acept i dont use the sqlite version of the component

i wish i knew what it was i am having real problems with foobar atm

might have to do a clean install of it
kl33per
I've built a new version of foo_playcounter (the original one, not kode54's SQL version). This version uses the LAST_PLAYED standard by default. It won't change your settings though, so if you're still using PLAY_DATE and PLAY_TIME it will remain that way. All new users should download this version.

foo_playcount 1.5.1 (Source & Binary Included)

If you have any feature requests, I'm willing to (attempt) to implement them.
kl33per
foo_playcount 1.5.2 (Source & Binary Included)

Adds support for the FIRST_PLAYED tag.
gob
QUOTE(kl33per @ May 14 2005, 01:18 AM)
foo_playcount 1.5.2 (Source & Binary Included)

Adds support for the FIRST_PLAYED tag.
*




wow. i like the sound of this new tag smile.gif

i wish there was a way to output these tags to an external database that is based on the files CRC. you would never loose tags for files that are renamed and/or moved.

this would also recuce the wear and tear due to defragmenting on my music drive, and the files will never change.
kl33per
The plugin has not been extensively bug tested, but should work as expected. It will write a FIRST_PLAYED tag if one does not already exist (not if PLAY_COUNTER = 0).

In regards to the database idea. kode54's version of this plugin already uses an external database. As for using file CRC's, if you change the tags within a file (eg. correct a spelling mistake) then your CRC will be messed up and will no longer work. Ultimately, I have no plans for implementing a external database. If you want, you can use kode54's version (but that doesn't support FIRST_PLAYED). Hopefully foobar2000 0.9 will support database only information, which will solve this ongoing debate.
gob
i used to add a tag to all my files called the %db_entry% that was basically the same thing. i ended up removing it because i thought it was useless. now i have thought of many interesting ideas to use it. now i wish i had kept all those tags.
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.