Skip to main content
Topic: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (Read 28576 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 #225
Simple solution: for now, don't use %lastfm_play_count%. Use a combination of %play_count% and %lastfm_play_count% and make sure both of them are zero.

I'm aware of that solution and of your recommendation to use foo_playcount in combination with your component, but it has proven to be so unreliable in the past (not the component itself, but internal playcounters in general, given how often I tweak, crash and rebuild my foobar2000) that I'd rather do without, for now. I guess I will do some mass-scrobble-pulling every now and than to keep lastfm playcounts updated, but if you ever make up your mind on solution number 3, you already have my support.
I'm late

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

Reply #226
but it has proven to be so unreliable in the past (not the component itself, but internal playcounters in general, given how often I tweak, crash and rebuild my foobar2000) that I'd rather do without, for now.
Ahhh, so you aren't using foo_playcount. That makes a little more sense. FTR, foo_playcount + foo_jesus + moving your index_data folder to dropbox or some other cloud storage location (and symlink/junction it back to the foobar folder) makes it basically bulletproof.

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

Reply #227
I'm wondering if I could use this to update my local playcount, via the %lastfm_played_times% feature. Let me explain - I don't use last.fm, but I've been maintaining %play count% values locally for years now. I do almost all my listening on my computer, so the only time this is a problem is when I listen from my phone. There, I have a last.fm scrobbler installed, which caches a list of the played tracks on the phone. So what I do is every end of the week I go through this list, and manually update every single song mentioned back on my computer files, and then nuke the cache. It can get really time-consuming when I've got 100+ entries to update, so I've been looking for an upgrade to this method, and the one thing that occurs to me is to make a last.fm account for only my phone, actually scrobble the cache to it, use this plugin to tag %lastfm_played_times% in my computer, and then with some other plugin tag %playcount% + %lastfm_played_times% = %playcount%. Does that make sense to you? Or, do you think there's an easier way perhaps?

Some problems that I can think of if I do it: (1) does this plugin retrieve %lastfm_played_times% from "artist - album - track", or just "artist - track"? Because if the latter, then I'd have the problem of the same song being tagged twice if present on both a studio album and compilation (2) it seems to me that every time I'd run this hypotethical %playcount% + %lastfm_played_times% = %playcount% equation, I'd have to nuke all my last.fm playcounts so that they don't get added to the sum the next time, correct?

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

Reply #228
Is there an way to import in to another variable the global playcount of an track from last.fm instead my personal playcount?
I want to create a autoplaylist that rank my songs sorting by most played songs in last.fm.
Thank you guys.

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

Reply #229
Hi, the plugin has stopped working for me.

Code: [Select]
Querying last.fm: http://ws.audioscrobbler.com/2.0/?method=user.getartisttracks&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=m1rass&artist=Jorge+Ben&limit=200&format=json&page=1
Found 0 plays in last.fm (since last recorded scrobble) of Jazz Potatoes

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

Reply #230
I'm wondering if I could use this to update my local playcount, via the %lastfm_played_times% feature. Let me explain - I don't use last.fm, but I've been maintaining %play count% values locally for years now. I do almost all my listening on my computer, so the only time this is a problem is when I listen from my phone. There, I have a last.fm scrobbler installed, which caches a list of the played tracks on the phone. So what I do is every end of the week I go through this list, and manually update every single song mentioned back on my computer files, and then nuke the cache. It can get really time-consuming when I've got 100+ entries to update, so I've been looking for an upgrade to this method, and the one thing that occurs to me is to make a last.fm account for only my phone, actually scrobble the cache to it, use this plugin to tag %lastfm_played_times% in my computer, and then with some other plugin tag %playcount% + %lastfm_played_times% = %playcount%. Does that make sense to you? Or, do you think there's an easier way perhaps?

Some problems that I can think of if I do it: (1) does this plugin retrieve %lastfm_played_times% from "artist - album - track", or just "artist - track"? Because if the latter, then I'd have the problem of the same song being tagged twice if present on both a studio album and compilation (2) it seems to me that every time I'd run this hypotethical %playcount% + %lastfm_played_times% = %playcount% equation, I'd have to nuke all my last.fm playcounts so that they don't get added to the sum the next time, correct?
Wow, that's a lot of work. You could do that, but you would have to manually clear all last.fm scrobbles after every pull.

What I'd do if I were you is to not manually update the %playcount%. Start scrobbling to last.fm, and then in your theme instead of showing %playcount% show $add(%playcount%, %lastfm_playcount%). It's a little more work if you use it in a bunch of spots in your theme, but you can easily do a $puts(playcount, $add(%playcount%, %lastfm_playcount%)) at the start of your theme, and then just use $get(playcount) everywhere and it's pretty simple.

The plugin has the option (on by default) to compare with album name as well. Be aware this toggle only works at pulling scrobble time. Switching it won't change the value of %lastfm_play_count% unless you clear the scrobbles for songs and repull.

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

Reply #231
Hi, the plugin has stopped working for me.

Code: [Select]
Querying last.fm: http://ws.audioscrobbler.com/2.0/?method=user.getartisttracks&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=m1rass&artist=Jorge+Ben&limit=200&format=json&page=1
Found 0 plays in last.fm (since last recorded scrobble) of Jazz Potatoes

Looks like last.fm has officially killed the old API method. You'll have to update to the latest beta. I'll push it to the component registry and try and push a non-beta version later this week.

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

Reply #232
Wow, that's a lot of work. You could do that, but you would have to manually clear all last.fm scrobbles after every pull.

What I'd do if I were you is to not manually update the %playcount%. Start scrobbling to last.fm, and then in your theme instead of showing %playcount% show $add(%playcount%, %lastfm_playcount%). It's a little more work if you use it in a bunch of spots in your theme, but you can easily do a $puts(playcount, $add(%playcount%, %lastfm_playcount%)) at the start of your theme, and then just use $get(playcount) everywhere and it's pretty simple.

The plugin has the option (on by default) to compare with album name as well. Be aware this toggle only works at pulling scrobble time. Switching it won't change the value of %lastfm_play_count% unless you clear the scrobbles for songs and repull.
I think your solution is very appropriate, thanks. Indeed it is a lot of work to do it the way I've been handling it, yesterday I spent more than an hour in what is probably the last time (hooray!). Okay so after installing the plugin, I realize it works like the base plugin, obviously, in that the data is retrieved after playback. Not ideal for me since I'd have to play the song here on the computer for it to get updated. I'll look into implementing the apparently still-working marc script, or doing this. Hopefully either works. Thanks again for orienting me, and keeping last.fm sync alive!

 

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

Reply #233
Huge beta update today (sorry for never getting out of beta in the last one... it's stable):

Big change here is no more synchronous last.fm API calls. When manually pulling scrobbles no longer wait for previous request and instead use the thread pools marc2k3 recommended to me to make async calls once per 200ms (the last.fm API rate limit). Now when retrieving scrobbles for 100 songs or more the action happens 5x faster minimum (probably closer to 10-20x).

This change is going to lay the groundwork for this component retrieving recent scrobbles automatically, so please test it out if you can.

NOTE: Unlike almost every other beta I've done, this one carries a warning. There is a non-zero chance that I've done the thread safety stuff incorrectly and your enhanced_playcount DB could be corrupted and you'd lose all that data. I suggest making a backup of index-data/0C1BD000-43E7-4078-B885-48EE4249DEC3 first before manually pulling scobbles. I've been using it just fine and tried to break it multiple times and can't, but we're dealing with race conditions and other weirdness so I might've missed something. Feel free to review my PR if you're so inclined.

v4.1.0b1
 - No more synchronous last.fm API requests
 - refresh metadb every 25 songs updated
 - refactored some code to make maintenance easier

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

Reply #234
I'm assuming since nobody reported anything that the previous beta was working well. New version out today which refactored a bunch of code, removed some dead code, and added... automatic recent scrobble pulling on startup! When foobar starts, the component pulls the last 200 scrobbles and checks your entire library to see if any songs need to be updated.

This is very much a work in progress and will change drastically in the next week or two, although it should work perfectly fine now.
Eventually it'll pull new scrobbles and retrieve older scrobbles to make sure your last.fm scrobble count is up to date. Right now this can't be disabled, although options will be added. It will also dumbly pull and check the last 200 scrobbles no matter what, so if you open foobar wait 2 minutes for the check to finish, close foobar and reopen it'll recheck the same exact songs. That's my first order of business to change. It also doesn't honor your "check album" setting either. That's beta3 as well.

As always, let me know if I screwed something up.

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

Reply #235
something wrong with beta 2
foobar2000 has crashed

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

Reply #236
something wrong with beta 2
foobar2000 has crashed
Can you give me a little more information about when it crashed (i.e. at startup)? What you were doing when it crashed? Were you manually pulling scrobbles? Is it repeatable?  Can you supply a debug log?

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

Reply #237
Just replacing beta 1 with beta 2 (Launch is interrupted by an error)
I hope the attached information will be useful.

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

Reply #238
Just deleted \configuration\foo_enhanced_playcount.dll.cfg, and the problem is solved.

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

Reply #239
Just deleted \configuration\foo_enhanced_playcount.dll.cfg, and the problem is solved.
You don't happen to have a backup copy of your config file from foo_jesus or something, do you? I didn't make any changes to the configuration settings between beta1 and beta2 so this is pretty weird.Nevermind, I spotted the issue from the minidump and replicated locally. Thanks!

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

Reply #240
I have the same problem with the same solution. I'll add both config files (one causes crash, one does not) so you can look at it.

EDIT: On second look, the only difference between the two is that one has my lastfm username and the other does not. So this is really not a fix as it just disables scrobble pulling at all. When I add my lastfm username it crashes again.

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

Reply #241
Yup, after thinking further I realized that was what was going on. Fortunately the minidump was enough for me to spot the issue (I wasn't handling the case where a scrobble didn't have an album name listed).

I present 4.1.0b3 - This version automatically pulls recent scrobbles and legacy scrobbles. There's no way to defeat this right now, but I'll add that before an official release.
On startup I pull the 1000 most recent scrobbles and check each song in the library that matches them and then pull all scrobbles for those songs. I then record the newest and oldest scrobble I pulled in this manner.
Every 12 songs played after that (roughly an hour I'm hoping?) I pull the 1000 scrobbles older than than the earliest scrobble known and then check each song individually.
EVENTUALLY all scrobbles for your entire library will have been pulled (I hope).

I also fixed the crash that was reported by DVS and Odinos.

Whoops, premature. Just found another crash....

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

Reply #242
v4.1.0b4
 - Fixed more crashes
 - threading recent scrobble puling now to avoid blocking UI
 - only pulling 500 instead of 1000 right now.

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

Reply #243
Beta 4, Still crashes. After deleting the configuration, it works, but after adding the username, it crashes again.

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

Reply #244
Beta 4, Still crashes. After deleting the configuration, it works, but after adding the username, it crashes again.
Works fine here

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

Reply #245
Beta 4, Still crashes. After deleting the configuration, it works, but after adding the username, it crashes again.
Give me another crash minidump if you can, and also your last.fm username if you wouldn't mind.

Works fine here
It's related to the tags or whatever is in last.fm. Most likely it's bogus data which is causing the library search query to be invalid (it's particularly finnicky). At the moment I'm not gracefully handling crashes there so I can track down these error corner cases.

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

Reply #246
another crash minidump,
davserg (last.fm)

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

Reply #247
Thanks. The issue was with songs containing double-quotes (particularly this one)

Fixed in beta 5. I was able to pull your entire recent scrobble list without issue (the first 500 songs anyway).


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

Reply #248
Works great, thanks!

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

Reply #249
Hopefully the last beta. Fixed a few more niggling issues,

v4.1.0b6 - Better handling of strings with double-quotes (it didn't crash, but it was impossible to get matches for these until now)
 - Pull new scrobbles every 5 plays
 - Pull legacy every 12
 - If quitting, abort threads immediately (fixed a deadlock issue when quitting during a pull)

 
SimplePortal 1.0.0 RC1 © 2008-2019