Skip to main content
Topic: foo_enhanced_playcount - Record all song plays and Last.fm scrobbles (JScript) (Read 10111 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 (JScript)

Reply #75
Can you paste the URL from the console that it's hitting for that track? I'll need to inspect the JSON.

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

Reply #76
Can you paste the URL from the console that it's hitting for that track? I'll need to inspect the JSON.
Code: [Select]
Opening track for playback: "D:\123\Music\The Kooks\Inside In-Inside Out (2006)\08 - Matchbox.mp3"
Querying last.fm: http://ws.audioscrobbler.com/2.0/?method=user.getartisttracks&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=123&artist=The+Kooks&limit=200&format=json&page=1
Musicbrainz: Invalid/missing MBID
Found 1 plays in last.fm (since last recorded scrobble) of Matchbox

I think the issue is in updating the value or an older version bug, because if I clear saved last.fm plays and refetch the info it gets the correct amount, just tested on some songs.

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

Reply #77
I think the issue is in updating the value or an older version bug, because if I clear saved last.fm plays and refetch the info it gets the correct amount, just tested on some songs.
That could be. With the relaxed pattern matching of song titles/albums now in the latest beta it should pick up more scrobbles than it did before, and since it only checks up to the last scrobble you might need to clear and repull for songs with special characters in the name (such as the / in "Inside In/Inside Out").

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

Reply #78
%added_enhanced% works as expected [returns earliest of %added% and %lastfm_first_played%] but %first_played_enhanced% and  %last_played_enhanced% doesn't returns the values of %first_played% and %last_played% until the file is played.



The album is played and registered in foo_playcount but never scrobbled to last.fm.
The code used for columns has this format:

Code: [Select]
$if2($left(%last_played_enhanced%,10),<<<n/a>>>)

Once I play the file again %first_played_enhanced% and  %last_played_enhanced% returns a value just before the component looks for last.fm data.

Code: [Select]
Found 0 plays in last.fm (since last recorded scrobble) of Horde







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

Reply #79
Also I found a problem with the characters ê and Ê but I don't know if is a problem of last.fm or the component.

The song "Café De L'Enfer - Je Ne Veux Plus Être Pieux" only return the last.fm data if is renamed as "Café De L'Enfer - Je Ne Veux Plus être Pieux"

Code: [Select]
Found 0 plays in last.fm (since last recorded scrobble) of Je Ne Veux Plus Être Pieux

Code: [Select]
Found 1 plays in last.fm (since last recorded scrobble) of Je Ne Veux Plus être Pieux

The song is named " Café de l'enfer — Je ne veux plus être pieux " in last.fm

Edit:

The problem is not only with "^", if I change "Café" for "Cafe" the data is not returned.

Code: [Select]
Found 0 plays in last.fm (since last recorded scrobble) of Je Ne Veux Plus être Pieux

Could you add and exception for acute, thick, diacritic, ... accents in Album/Title comparisons like the one with '(', ')', and '&'?

If 'á', 'à', 'ä', 'â' equal 'a' the positives matches will increase a lot.




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

Reply #80
%added_enhanced% works as expected [returns earliest of %added% and %lastfm_first_played%] but %first_played_enhanced% and  %last_played_enhanced% doesn't returns the values of %first_played% and %last_played% until the file is played.
First off, thanks for testing the component! Secondly, god damnit... you discovered a major bug. :(

I have fixed the first issue with first_played_enhanced and last_played_enhanced not returning anything until the song is played. Really good catch. It's fixed in the beta 3 version attached below.

Your second problem is actually pretty huge, although it doesn't seem like it would be. What your propose (mapping 'á', 'à', 'ä', 'â' to 'a') is the perfect solution... there's just one problem, and it's how foobar handles multi-byte characters. Turns out that foobar takes those characters from the tags, which I'm 100% positive are not multi-byte and munges them internally so that they are. Therefore the string:
"Écailles de lune" becomes "Écailles de lune". The strings returned from last.fm are similarly converted, so as long as they have the name as "Écailles de lune" then the match will work correctly, however if the name in last.fm is "écailles de lune" instead, that string will become "écailles de lune" in foobar, and the match will fail.

Now you might think the solution would be to just skip all multibyte characters, but then we can't do comparisons on songs like "『眩暈』。" by the band té.

As of this moment, I have no idea how to fix this issue. I'm going to need to go back to the drawing board and re-examine foobar's string datatypes and see if there's something else I can do instead. Right now I'm seeing a bunch of my French songs in particular being caught up by this with diacritic comparisons failing because last.fm has a different capitalization case then my library does.


Turns out foobar has a stringCompareCaseInsensitive method which handles this issue just perfectly. Beta 4 below has the fix in it. Let me know if you're still seeing issues.

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

Reply #81
%added_enhanced% works as expected [returns earliest of %added% and %lastfm_first_played%] but %first_played_enhanced% and  %last_played_enhanced% doesn't returns the values of %first_played% and %last_played% until the file is played.
First off, thanks for testing the component! Secondly, god damnit... you discovered a major bug. :(

I have fixed the first issue with first_played_enhanced and last_played_enhanced not returning anything until the song is played. Really good catch. It's fixed in the beta 3 version attached below.

Your second problem is actually pretty huge, although it doesn't seem like it would be. What your propose (mapping 'á', 'à', 'ä', 'â' to 'a') is the perfect solution... there's just one problem, and it's how foobar handles multi-byte characters. Turns out that foobar takes those characters from the tags, which I'm 100% positive are not multi-byte and munges them internally so that they are. Therefore the string:
"Écailles de lune" becomes "Écailles de lune". The strings returned from last.fm are similarly converted, so as long as they have the name as "Écailles de lune" then the match will work correctly, however if the name in last.fm is "écailles de lune" instead, that string will become "écailles de lune" in foobar, and the match will fail.

Now you might think the solution would be to just skip all multibyte characters, but then we can't do comparisons on songs like "『眩暈』。" by the band té.

As of this moment, I have no idea how to fix this issue. I'm going to need to go back to the drawing board and re-examine foobar's string datatypes and see if there's something else I can do instead. Right now I'm seeing a bunch of my French songs in particular being caught up by this with diacritic comparisons failing because last.fm has a different capitalization case then my library does.


Turns out foobar has a stringCompareCaseInsensitive method which handles this issue just perfectly. Beta 4 below has the fix in it. Let me know if you're still seeing issues.

Goddam you're fast !!!

I don't even have time to download the beta 3 and test the first fix  ;)
All of them working perfect right now.

Thanks to you for the component and the quick fix.

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

Reply #82
Haha, I decided I was just going to stop messing with it and go to bed, and so of course I spent another 20 minutes going through SDK header files trying to find something that solved the problem. Fortunately I lucked out :)

Gonna give this beta a few days and then officially release version 3.0.

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

Reply #83
Gonna give this beta a few days and then officially release version 3.0.

Happy to make all the posible test to improve it.

I have a big library with a lot of diferents player used along the years and diferents scenarios.

This plugin is a great oportunity to consolidate the playcount and use it with dinamics fields autorating and make it more acurate.

I think I found another discrepancy in %last_played_enhanced%.

Cleaning lastfm data to test again from the begining.



Then I run get lastfm scrobbles in the files



As you can see %last_played_enhanced% doesn't honor the latest value of %last_played% in the foo_playcount db and return the %lastfm_last_played%



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

Reply #84
For some reason this component stopped working and only displaying 0 for last.fm play counts. This was several component versions ago and I stopped using it. I tried the latest version now but still the same, only 0 no matter how many times something is played, older or recent scrobbles. My lastfm user name is set correctly. None of the other fields seem to work either. They either show N/A or nothing at all.

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

Reply #85
For some reason this component stopped working and only displaying 0 for last.fm play counts. This was several component versions ago and I stopped using it. I tried the latest version now but still the same, only 0 no matter how many times something is played, older or recent scrobbles. My lastfm user name is set correctly. None of the other fields seem to work either. They either show N/A or nothing at all.
Is it making calls to last.fm? Can you clear a scrobble for a song, and then repull and then paste one of the URLs here please? Also let me know if the console says it found any scrobbles for the song.

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

Reply #86
It is indeed making calls. Console mentions
Code: [Select]
Querying last.fm: http://ws.audioscrobbler.com/2.0/?method=user.getartisttracks&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=jazzthieve&artist=Nick+Drake&limit=200&format=json&page=1
Found 11 plays in last.fm (since last recorded scrobble) of Day Is Done

I've cleared last.fm saved plays and then tried get last.fm scrobbles. Console gives the same again:

Code: [Select]
Querying last.fm: http://ws.audioscrobbler.com/2.0/?method=user.getartisttracks&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=jazzthieve&artist=Nick+Drake&limit=200&format=json&page=1
Found 11 plays in last.fm (since last recorded scrobble) of Day Is Done

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

Reply #87
As you can see %last_played_enhanced% doesn't honor the latest value of %last_played% in the foo_playcount db and return the %lastfm_last_played%
Okay, that's weird. I had tested this during development, and just retested now and I can't reproduce it.

Only thing I could think of that would maybe effect it, do those files have last_played information written to them?

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

Reply #88
It is indeed making calls. Console mentions
Code: [Select]
Querying last.fm: http://ws.audioscrobbler.com/2.0/?method=user.getartisttracks&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=jazzthieve&artist=Nick+Drake&limit=200&format=json&page=1
Found 11 plays in last.fm (since last recorded scrobble) of Day Is Done
Hmmmm. So the component is working correctly, but it looks like it can't write/read to the database properly. Do you mind uploading a copy of the database somewhere where I can figure out what's going wrong?

Close foobar and then the file is 0C1BD000-43E7-4078-B885-48EE4249DEC2 and It's located in index-data/

Also, if you could take a screen shot of the properties for that Nick Drake song (so I can tag an mp3 the same to match) that would be helpful.

Your other option is to close foobar, backup the database file somewhere, delete it from index-data, then restart and see if the component starts working for you again.

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

Reply #89
I tried your suggestion of deleting the database and restarting. It works again and the component receives the scrobbles correctly now. Following your suggestion I have hunch that perhaps it had something to do with me running foobar portable on a ramdisk. Runs fine but ever since I'm doing that the recycle bin is acting a bit funky with files deleted from that ramdisk location.

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

Reply #90
I tried your suggestion of deleting the database and restarting. It works again and the component receives the scrobbles correctly now. Following your suggestion I have hunch that perhaps it had something to do with me running foobar portable on a ramdisk. Runs fine but ever since I'm doing that the recycle bin is acting a bit funky with files deleted from that ramdisk location.
Good deal. If you aren't using foo_jesus, you should be, and make sure index-data is in the backup list. If things go sideways with any databases you won't have to restart from scratch.

Also just to check, that database wasn't some crazy size was it? I might be concerned if it was over 10MB or something.

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

Reply #91
Nope, was 64kb. Don't have foo_jesus, perhaps time to set that one up. Thanks for the help.

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

Reply #92
Okay, that's weird. I had tested this during development, and just retested now and I can't reproduce it.

Only thing I could think of that would maybe effect it, do those files have last_played information written to them?

No, the only reference of last played is in the "details" tab.





And the behavior is the same with other files in the same situation.

for example:







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

Reply #93
Just curious, if you play one of those Corcobado songs for a minute does the %last_played_enhanced% value correct itself?

Can you copy your database online for me to download? It's the index-data/0C1BD000-43E7-4078-B885-48EE4249DEC2 file. Could also use foo_playcount's db as well (C653739F-14B3-4EF2-819B-A3E2883230AE). Feel free to PM me or whatever. I have that Mer de Noms album so I won't have trouble matching the tracks up. Preferably leave that album in the state where the values are incorrect :)

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

Reply #94
Just curious, if you play one of those Corcobado songs for a minute does the %last_played_enhanced% value correct itself?

The value correct itself at the moment the file start playing, doesn't even need a minute

Can you copy your database online for me to download? It's the index-data/0C1BD000-43E7-4078-B885-48EE4249DEC2 file. Could also use foo_playcount's db as well (C653739F-14B3-4EF2-819B-A3E2883230AE). Feel free to PM me or whatever. I have that Mer de Noms album so I won't have trouble matching the tracks up. Preferably leave that album in the state where the values are incorrect :)

No problem, I try to PM you right now



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

Reply #95
The value correct itself at the moment the file start playing, doesn't even need a minute
Haha, I don't even see how this could be possible. You're on v3.0.2 of foo_playcount right?


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

Reply #97
Okay, I've been able to reproduce the problem on my own database. I do my development and testing in a portable install of foobar to avoid cluttering up my actual databases, so I had no songs with playcounts before I started development on this component which is why I never ran into this. I should have a fix shortly.

Of course, while looking at paregistrase's DB, I realized that my hashes were case sensitive. If my song title was "When The Levee Breaks" and I used a tagger outside foobar to correct it to "When the Levee Breaks" the component will lose the value in the database. That leaves me three options:
1) I can force everyone to start over with a brand new database (far from ideal)
2) figure out someway to migrate all the old hashes to case-insensitive hashes (this may not be possible)
3) I live with a component that can't tell that "The" and "the" should hash to the same value (I will hate myself)

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

Reply #98
Okay, I've been able to reproduce the problem on my own database. I do my development and testing in a portable install of foobar to avoid cluttering up my actual databases, so I had no songs with playcounts before I started development on this component which is why I never ran into this. I should have a fix shortly.

Of course, while looking at paregistrase's DB, I realized that my hashes were case sensitive. If my song title was "When The Levee Breaks" and I used a tagger outside foobar to correct it to "When the Levee Breaks" the component will lose the value in the database. That leaves me three options:
1) I can force everyone to start over with a brand new database (far from ideal)
2) figure out someway to migrate all the old hashes to case-insensitive hashes (this may not be possible)
3) I live with a component that can't tell that "The" and "the" should hash to the same value (I will hate myself)

If the new database is the component database it is not a big deal, only have to get the last.fm scrobbles again.

If it is the play_count db could be a problem  :P

 

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

Reply #99
Don't worry, I don't own foo_playcount, so I can't mess with that DB. It looks like it's possible to migrate the hashes to a new DB and delete the old one so I guess that's what I'll be playing with over the next day or so.

Beta 5 fixing the %first/last_played_enhanced% issue:

 
SimplePortal 1.0.0 RC1 © 2008-2018