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: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (Read 89247 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles

Reply #375
Thanks for the reply. I was using 2.0 beta v17 (32bit), though I just updated to the newest beta this morning, and also discovered the alternative last.fm component by marc2k3 which is working well so I'm using that at least for the time being (though I will miss the automatic fetching of recent scrobbles...)

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles

Reply #376
5.0.0 beta 1 here:

Supports x64, dark mode, 2.0 SDK etc. Everything appears to be working fine, but I need more testers.

Nevermind

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles

Reply #377
@iridescentaudio I was looking at the code tonight. On startup it will pull up to 800 songs from the last scrobble it knows about to attempt to keep everything in sync.

Historical scrobbles will initially show a time around 1970-01-01 if you reset it (I should change how this displays), but after playing 12 songs, the historical scrobble pull will move backward in time from the earliest scrobble date it has checked and grab 1000 songs. Play 12 more songs, and it'll grab another 1000. You won't see the date move otherwise.

I checked the CPU during a historical scrobble pull on a new beta24 x86 install and there was nothing out of the ordinary. CPU usage was around 1% during the fetching and then querying for each songs phase. Try the beta above and let me know if your CPU issues still persist. Peter moved the entire metadb database back into memory with beta 18, so it's possible your issues were entirely related to that temporary change which I know had a bad performance effect for some people.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles

Reply #378
5.0.0 beta 1 here:

Supports x64, dark mode, 2.0 SDK etc. Everything appears to be working fine, but I need more testers.

https://www.dropbox.com/s/5p88kdyvm6feiy4/foo_enhanced_playcount-v5.0.0b1.fb2k-component?dl=0

Haha, it was yesterday I've asked you about it =)
Thanks a lot, it's good that your motivation is slightly back.

-TT

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles

Reply #379
Haha, it was yesterday I've asked you about it =)
Thanks a lot, it's good that your motivation is slightly back.

-TT
My motivation wanes with every "unresolved external symbol" linker error I have to figure out. :P

My problem is that once I start fiddling with a project I can't force myself to stop. I'm up till 3AM every night trying to tie up every last loose end, etc. So I go through starts and stops with this stuff in an attempt to keep myself (relatively) sane.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles

Reply #380
v5.0.0b1 seems to work fine on 1.6.x, but on 2.0 only manual scrobble pulls work. For some reason it's unable to search the library in the same way that the old version does. Not sure if that's a bug, or more likely my implementation is messed up.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles

Reply #381
The library in v2 is loaded asynchronously so code like this...

Code: [Select]
metadb_handle_list items;
library_manager::get()->get_all_items(items);

will return 0 items if you run it too early.

You can verify it with scripting components too. var items = fb.GetLibraryItems() on fb2k startup returns 0 items as well. It probably goes unnoticed because library viewers will have on_library_items_added which will update themselves.

You might want to look at on_library_initialized here

https://github.com/marc2k3/foobar2000-sdk-2/blob/c2b5293e8107af51b9d1b3daab66da31e0459474/foobar2000/SDK/library_callbacks.h#L25-L32

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles

Reply #382
The library in v2 is loaded asynchronously so code like this...

Code: [Select]
metadb_handle_list items;
library_manager::get()->get_all_items(items);

will return 0 items if you run it too early.
You're a damn genius you know that? on_library_initialized fixed my problem.

Also is there a list of changes for how 2.0 works compared to 1.6 or do I just need to have been following a bunch of different threads for the last few months?

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles

Reply #383
I looked at your github and that code looks so wrong (to me) that I can't believe it worked??

I'm submitting a PR.  :))

edit: as for keeping up, I just search the SDK for this to look for new goodies on release...

Code: [Select]
//! \since 2.0

late edit: my PR didn't even compile. What a genius I am.  ;D

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles

Reply #384
I looked at your github and that code looks so wrong (to me) that I can't believe it worked??

I'm submitting a PR.  :))
PR definitely helped my understanding of what I'm supposed to do. Also I barely knew how the pre 2,0 SDK worked, and so adding 61 new things with very little documentation and a foo_sample that hasn't been updated to use any of the new stuff means I'm just throwing darts in the dark :))

I'm hopeful that situation will improve once 2.0 gets out of beta and the SDK is somewhat more locked down.

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles

Reply #385
5.0.0 beta 2
 - In 2.0 component now waits for library to load before pulling scrobbles
 - Actually removes duplicate hashes when pulling recent/historical scrobbles. This speeds up scrobble pulls if you have multiple copies of the same albums in your library (i.e. different encodes, editions, etc.) and cuts down on console spam
 - Next historical scrobble pull shows the correct date, and the reset button now sets next pull date to current time. This fixes a bug where pulls after a reset did not work correctly.
 - Component is now referred to everywhere in the UI as "Playback Statistics Enhanced", instead of confusingly sometimes calling itself "Playcount Enhanced"

I think this is the one. If a few people can test this out and make sure there are no problems, I'll release a 5.0.0 official in a few days.

https://www.dropbox.com/s/qkcxy7eqm8vi5z5/foo_enhanced_playcount-v5.0.0b2.fb2k-component?dl=0

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles

Reply #386
How to do a reverse import of information??? Statistics were lost for a certain period. At the same time, there are statistics that are not in last fm and there is information on the site that is not in the player

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles

Reply #387
@iridescentaudio I was looking at the code tonight. On startup it will pull up to 800 songs from the last scrobble it knows about to attempt to keep everything in sync.

Historical scrobbles will initially show a time around 1970-01-01 if you reset it (I should change how this displays), but after playing 12 songs, the historical scrobble pull will move backward in time from the earliest scrobble date it has checked and grab 1000 songs. Play 12 more songs, and it'll grab another 1000. You won't see the date move otherwise.

I checked the CPU during a historical scrobble pull on a new beta24 x86 install and there was nothing out of the ordinary. CPU usage was around 1% during the fetching and then querying for each songs phase. Try the beta above and let me know if your CPU issues still persist. Peter moved the entire metadb database back into memory with beta 18, so it's possible your issues were entirely related to that temporary change which I know had a bad performance effect for some people.

Apologies for being slow getting back to you, I'm testing it out today and everything seems to be smooth sailing so far, I haven't noticed the same CPU spikes I was having before, and the idiosyncratic behaviour with the pull date has stopped. Now picking up scrobbles from the last several months and re-jigging my columns. I'll let you know if I notice anything strange but so far, so good - thank you for your hard work!

Re: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles

Reply #388
Apologies for being slow getting back to you, I'm testing it out today and everything seems to be smooth sailing so far, I haven't noticed the same CPU spikes I was having before, and the idiosyncratic behaviour with the pull date has stopped. Now picking up scrobbles from the last several months and re-jigging my columns. I'll let you know if I notice anything strange but so far, so good - thank you for your hard work!
That's awesome! Must have been an issue with the beta versions then. Glad everything is working again.