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 128371 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 #200
It was my understanding selecting increments meant the last.fm playcount would increment when it's played.
Well, the way it works right now is that it adds 1 to %lastfm_play_count%, whenever %last_played% is more than 5 minutes greater than %lastfm_last_played%. This will have the effect of bumping the %lastfm_play_count% once the song reaches 1 minute elapsed and %play_count% increments, but it also will bump %lastfm_play_count% if for whatever reason foobar counted a play, but it was never recorded in lastfm (scrobble was ignored/lost, didn't play 50% of the song, etc.). This makes %lastfm_play_count% behave more as a super conservative "guess" at total active playcount: i.e. we know lastfm has 14 scrobbles of this song, and there's at least one we don't know about.

With the option enabled, could you play Stories From the Streets all the way through (and make sure it gets scrobbled), and then see if the numbers sync back up?

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

Reply #201
I played said track with increments enabled. It was at 14 actual plays and 14 actual scrobbles but %lastfm_play_count%, indicated 15 plays as seen in the previous screenshot. When played fully it changed to 15 actual plays and thus equals %lastfm_play_count%, the actual checked scrobble is also 15. So now I have this particular track correct while all other are off by 1.
If I disable increments, restart foobar all other tracks are correct but now it's Stories From the Streets that's wrong. %lastfm_play_count% is at 14 and only when I import it gets corrected to 15.
I played the same track again this time with increments disabled and the %lastfm_play_count% doesn't increment. Again, only when importing does it sync back up.
I can see why you'd implement the increment option. It's ok for as long you don't create a full comparison list like I did. The numbers didn't make sense to me. Some were right, some were not and always off by 1.  I think I'll be handling this differently, I have a dynamic playlist of recently played tracks of the last 24hours and just gonna update them with an import and sync them back up that way.

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

Reply #202
I have a request: would it be possible that if the track is less than 30 seconds, to have %lastfm_play_count% simply show the %play_count% amount? Or alternatively make something like %play_count_enhanced% if that feels too inconsistent. This is because last.fm doesn't keep track of tracks less than 30 seconds long, I have to add:
Code: [Select]
$ifgreater(%length_seconds%,30,%lastfm_play_count%,%play_count%)
a bunch of times which is a bit awkward. Also, thank you again for this plugin, it's really great!

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

Reply #203
I have a request: would it be possible that if the track is less than 30 seconds, to have %lastfm_play_count% simply show the %play_count% amount? Or alternatively make something like %play_count_enhanced% if that feels too inconsistent. This is because last.fm doesn't keep track of tracks less than 30 seconds long, I have to add:
Code: [Select]
$ifgreater(%length_seconds%,30,%lastfm_play_count%,%play_count%)
a bunch of times which is a bit awkward. Also, thank you again for this plugin, it's really great!
Unfortunately, I don't want to include %play_count% in the component itself because that relies on foo_playcount and doesn't come from this component. Probably 90% of users have that installed, but I still run into some who don't, and because I don't control foo_playcount it's hard to define a perfect solution there.

What I use everywhere in my personal theme is:
Code: [Select]
$max(%play_count%,%lastfm_play_count%)

// or
$puts(PC,$max(%play_count%,%lastfm_play_count%))
// combined with
$get(PC)
Using those is a little better for the use case where scrobbles were lost/missing/couldn't be found in last.fm.

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

Reply #204
Oh yeah that makes sense!  :D

I have another thing I noticed--a few tracks I have don't seem to give the right amount of scrobbles (even with the album tag turned off). For example this one:

Returns 0 plays even though you can see on my profile I have 43: https://www.last.fm/user/surasshu/library/music/ビートまりお/_/デスレーベル+95-97-02

A few other songs by this artist also give incorrect amounts, not always 0. This one gave me 25:

But on last.fm it lists 52 scrobbles: https://www.last.fm/user/surasshu/library/music/ビートまりお/_/サイドストームあらし

Any ideas what might be causing this, something I missed?

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

Reply #205
I have another thing I noticed--a few tracks I have don't seem to give the right amount of scrobbles (even with the album tag turned off). For example this one:

Returns 0 plays even though you can see on my profile I have 43: https://www.last.fm/user/surasshu/library/music/ビートまりお/_/デスレーベル+95-97-02
As you might imagine, the Japanese characters make it impossible for me to tell what's going because I can't really distinguish differences between them :D

Not sure what's happening here, but for debug purposes the best thing you can do is open up the console, start playback of a song having this issue, and then copy the last.fm URL that's shown in the console and paste it here. That'll enable me to debug.

 

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

Reply #206
New Beta v4.0.0b4:

Changelog:
When playing a new song, add a 2 second delay before pulling scrobbles to prevent hammering and stop spurious requests for songs that no longer exist in your library [defeatable]

This feature was added by marc2k3, so more thanks to him for his continued contributions!

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

Reply #207
Understandable! I found another song with a special character in it that isn't getting the correct playcount: 5% TINT by Travis Scott. Also for デスレーベル 95-97-02 (for reference it's called "beatmario - death label 95-97-02") I noticed I was missing a space between the name and the dates, so with that fixed I somehow got 19 plays out of the 43 on last.fm.

Here's the URLs from the console for those songs:
Travis Scott - 5% TINT: http://ws.audioscrobbler.com/2.0/?method=user.getTrackScrobbles&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=surasshu&artist=Travis Scott&track=5% TINT&limit=200&format=json&page=1

ビートまりお - デスレーベル 95-97-02: http://ws.audioscrobbler.com/2.0/?method=user.getTrackScrobbles&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=surasshu&artist=ビートまりお&track=デスレーベル 95-97-02&limit=200&format=json&page=1

I figure one beatmario song is as good as any other one for diagnostic purposes, but let me know if you need more!

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

Reply #208
Thanks, that's super helpful. I was stupidly not escaping %s so that wasn't working. Fixed now. The issue with your デスレーベル 95-97-02 is that duplicate scrobbles are being removed. See the tooltip on that option and see if you need to leave it checked or unchecked. Unchecking it shows the full 43 scrobbles.

v4.0.0b5
 - Escaping % in artist/title

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

Reply #209
Thank you! Those scrobbles are almost certainly legitimate--My guess is that foo_audioscrobbler sent them in a batch and that is what gave them all the same timestamp. I'll probably have to suck it up and turn that setting off--the downside of having almost 15 years of scrobbles... varying quality :D

Anyway thank you for the update as well!

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

Reply #210
The lastfm playcounts for new songs are forever stuck on 0 until I manually 'get scrobbles'. Is this expected behavior?

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

Reply #211
The lastfm playcounts for new songs are forever stuck on 0 until I manually 'get scrobbles'. Is this expected behavior?
Scrobbles only get pulled when you play a song, or when you manually retrieve them. They don't automatically get pulled when a song is added to your library if that's what you're asking.

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

Reply #212
Scrobbles only get pulled when you play a song, or when you manually retrieve them. They don't automatically get pulled when a song is added to your library if that's what you're asking.

No I mean it never moves from 0 even if I play it 100 times. Only if the playcount is 1 or higher it increments after each playback.

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

Reply #213
No I mean it never moves from 0 even if I play it 100 times. Only if the playcount is 1 or higher it increments after each playback.

Same here.
I'm late

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

Reply #214
No I mean it never moves from 0 even if I play it 100 times. Only if the playcount is 1 or higher it increments after each playback.
Okay, let me make sure I understand. You add a song to your library. This song has 10 scrobbles on last.fm. You hit play on the song, and %playcount% is 0 and %lastfm_playcount% is also 0.

Once the song has been played for a minute %playcount% shows 1 and %lastfm_playcount% now shows 10 or 11 (based on the increment setting). Is that correct?

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

Reply #215
Okay, let me make sure I understand. You add a song to your library. This song has 10 scrobbles on last.fm. You hit play on the song, and %playcount% is 0 and %lastfm_playcount% is also 0.

Once the song has been played for a minute %playcount% shows 1 and %lastfm_playcount% now shows 10 or 11 (based on the increment setting). Is that correct?

No, I add a song to my library, it has 0 scrobbles on last.fm, 0 on %playcount% and 0 on %lastfm_play_count%.

After I play the track 1 time it has 1 scrobble on last.fm, 1 on %playcount% and 0 on %lastfm_play_count%.

Only after I manually click 'get lastfm scrobbles' in the context menu, %lastfm_play_count% jumps to 1.

Once the manual action has occurred no more intervention is needed, it will correctly increment %lastfm_play_count% by 1 after each play.

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

Reply #216
Ahhh, now I understand the disconnect. As stated, the component only pulls last.fm scrobbles when playback starts or on a manual pull. When you play a song, %playcount% increments at 1 minute, but the scrobble is only sent as early as 50% playback (or way more likely after the song has finished). The "increment last.fm playcount when %playcount% increments" option is there to fake this behavior and try to keep the values in sync.

Now after you've played the song once, there are still zero scrobbles recorded for the song by the component, because it hasn't reached out to last.fm again to pull scrobbles for the song. The component doesn't add 1 to zero, because it can't differentiate between the following 3 use cases:

  • A new song, you've played exactly once, and scrobbled afterwards (your use case)
  • A song that was played X times before, but scrobbling was disabled or scrobbles could not be found because of a title/album mismatch
  • A song that was played X times before the component was added, and scrobbles have not been pulled yet.

I currently don't "fake" scrobbles unless the component has pulled and found at least one scrobble because anything I do is going to be wrong in 2 of the 3 situations. Let me know your thoughts/feedback.

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

Reply #217
I think I understand, but why is it checking for scrobbles at the start of playback instead of after playback if it causes this dilemma of trade-offs?

Nevertheless, pull on playback start does not work as intended. When I play a track 2 times (with a starting point of 0 scrobbles) %lastfm_play_count% still shows 0. This can only be fixed with a manual pull. I'll put a log below.

[00:36:34] Opening track for playback: "D:\Music Library\Pendant - Make Me Know You Sweet (2018)\06 - Pendant - OXI-GKK.mp3"
[00:36:38] foo_scrobble: Submitting track
[00:36:38] Found 0 plays in last.fm (since last recorded scrobble) of OXI-GKK
[00:42:57] Opening track for playback: "D:\Music Library\Pendant - Make Me Know You Sweet (2018)\06 - Pendant - OXI-GKK.mp3"
[00:43:01] foo_scrobble: Submitting track
[00:43:01] Found 0 plays in last.fm (since last recorded scrobble) of OXI-GKK

It seems that the lastfm query is skipped altogether. Again, this does not occur when the initial value of %lastfm_play_count% is anything else than 0.

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

Reply #218
The time stamps on those logs seem suspect to me. At 36:34 you start playing the song and at 36:38 foobar submits a scrobble, but that scrobble isn't for the song you're playing, it's the previous song. At 42:57 you start playing the same song again, and at 43:01 the scrobble for the previous play is submitted and at the exact same timestamp, we pull scrobbles. This seems like the last.fm API hasn't had a chance to record the scrobble yet when we're checking again. What happens if you play the song, play a different song, then play the first song again? Or just play that song the an hour or day later without manually pulling scrobbles for it in the interim.

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

Reply #219
The time stamps on those logs seem suspect to me. At 36:34 you start playing the song and at 36:38 foobar submits a scrobble, but that scrobble isn't for the song you're playing, it's the previous song. At 42:57 you start playing the same song again, and at 43:01 the scrobble for the previous play is submitted and at the exact same timestamp, we pull scrobbles. This seems like the last.fm API hasn't had a chance to record the scrobble yet when we're checking again. What happens if you play the song, play a different song, then play the first song again? Or just play that song the an hour or day later without manually pulling scrobbles for it in the interim.
Well, I went to test it out but I updated to 4.0b5 before I did and the problem does not occur anymore. Something changed between v3.0.7 and v4 that fixed the issue.

My question from the previous post still stands though, why is it checking for scrobbles at the start of playback instead of after playback if it causes this dilemma of trade-offs?

Btw I would like to thank you for this component and your support here.

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

Reply #220
Well, I went to test it out but I updated to 4.0b5 before I did and the problem does not occur anymore. Something changed between v3.0.7 and v4 that fixed the issue.

My question from the previous post still stands though, why is it checking for scrobbles at the start of playback instead of after playback if it causes this dilemma of trade-offs?

Btw I would like to thank you for this component and your support here.
Interesting. The last.fm API endpoint changed between 3.0.7 and 4.0.0b5, and they hit completely different databases apparently. The beta version uses the latest and greatest which is supposed to update faster. I expect that accounts for what you were seeing.

At minimum we have to pull scrobbles at playback start. If you only scrobble from foobar it doesn't matter, but if you're like me and you scrobble from iPod, and Android phone, you could have played a song X number of times between the last time you played it in foobar, and then the last.fm playcount in foobar would be X scrobbles out of date until the song was over. This particularly matters if you're trying to display this information while the song is playing (like I do) and don't care so much how accurate it is in a playlist.

The reason pulling afterwards doesn't work as well is that there could very well be a race condition between when we request scrobbles and when your scrobbling component submits them. How long do we wait before making the request? This matters a lot more if you're using foo_audioscrobbler where scrobbles often get queued up and aren't submitted right away. Now, I could pull before and after, and just hope for the best. I might make that an option if people find they really want it.

Thanks for the kind words :)

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

Reply #221
I understand. The before and after approach could work if you can solve the race condition problem. Maybe a customizable delay after playback, but that could complicate things too much.

Honestly I was (and am) still using the old Last.fm Playcount Sync by marc and it works very well still, but it relies on customdb which is not supported by columnsui anymore. Anyway, it seems to always have accurate lastfm playcount stats during and after playback, I don't know how it manages that though (I guess you could ask marc  :-X). It also supports lastfm autocorrected song titles which enhanced playcount cannot deal with atm (api limitation?).

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

Reply #222
Now after you've played the song once, there are still zero scrobbles recorded for the song by the component, because it hasn't reached out to last.fm again to pull scrobbles for the song.
Thanks for the explanation @MordredKLB, now at least the component's behavior has a logic. I'm not sure I understand the race condition problem, but for my needs this is a major flaw that almost makes the component useless. I'm not really interested in the precise number of scrobbles, but rather in whether I've listened to the track before or not. Never listened to before means not processed by me (tags checking, replaygain, beatunes analysis, etc..). I have an autoplaylist of unlistened tracks based on %lastfm_play_count% , which I use when I want to spend some time fixing "unprocessed" tracks and I expect the playlist to actually bring up such tracks. Instead, already processed tracks are still in the playlist until they're scrobbled twice.


it relies on customdb which is not supported by columnsui anymore.
Are you sure about this? I mean, customdb is officially not supported and actually deprecated, but I'm currently using it with columns UI 1.0.0 and it works as with previous columns UI versions.


Honestly I was (and am) still using the old Last.fm Playcount Sync by marc
I was never able to find that script online, would you mind sharing it?
I'm late

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

Reply #223
I have an autoplaylist of unlistened tracks based on %lastfm_play_count% , which I use when I want to spend some time fixing "unprocessed" tracks and I expect the playlist to actually bring up such tracks. Instead, already processed tracks are still in the playlist until they're scrobbled twice.
This is exactly my use-case as well, so I guess it would benefit more people to add that functionality.

Regarding the other stuff you mentioned, I will private message you about that as to stay on-topic.

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

Reply #224
I have an autoplaylist of unlistened tracks based on %lastfm_play_count% , which I use when I want to spend some time fixing "unprocessed" tracks and I expect the playlist to actually bring up such tracks. Instead, already processed tracks are still in the playlist until they're scrobbled twice.
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.

Going forward I plan to do two things:
1) Use the same +1 logic for %lastfm_play_count% if we have an existing record for the song with a %play_count% saved. That means the song was played at least once with the component, and we can assume was probably scrobbled at that time.
2) Try and do a %play_count_enhanced% like I've done elsewhere that returns the greater of %play_count% and %lastfm_play_count%. Not sure this will work perfectly since I don't provide %play_count% (and why I didn't do it before) but I'll give it a go.

3) I might consider doing the pull scrobbles after song ends thing, but that gets kinda tricky. Will see.

For now, I just reformatted my computer and have to reinstall everything before I can work on this again.