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: HOW TO: synchronise your last.fm playback stats with foobar (Read 383469 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #850
Thanks for this great script! Is it supposed to fetch scrobbles from other devices automatically in the background or do I have to do a full reimport each time? Didn't seem to catch them the first time i tried.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #851
if you the import right now then all the data is current.
then if you subsequently scrobble from other devices then of course the playcounts will be out of sync.
the background updates only work when you play the track again and listen to enough of it to count for another scrobble. it then fetches the new value including the scrobble(s) from other devices. but of course this only happens on a track by track basis and you might not even play tracks in foobar that you've recently scrobbled from another device.

either deal with it or run the full import on a semi-regular basis.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #852
OK thanks for the feedback

Would it be possible to cache the last imported scrobble and allow incremental updates from there? I'm using lastfm2itunes to get the scrobbles into iTunes and these incremental updates work pretty well.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #853
i remember rejecting the request last time it was asked.

if i can figure out how to increment values in sqlite, it might be doable.... well actually i already know to increment values if they exist but i don't know how to combine this with writing a new record with a playcount of 1 if it doesn't.

edit: thinking about it some more, i'm not sure if i can really implement this properly. when i do i generate the timestamp to go back to? if it's from the last scrobble performed inside foobar, it could miss earlier scrobbles from other devices. or if it's from the last full import time, there would could be scrobbles since that will be artificially inflated by counting them again. at least with feeds i use, i'm getting actual values from last.fm rather than incrementing current db values by one for each play which is what that itunes thing does. i'm having serious doubts over how useful it can be.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #854
Ah I see, I thought you were already using the same full scrobble feeds (which would take a LOT longer during the initial import). The only safe way I can think of would be a second value for each track with the amount of times the play count was  increased by the dynamic update, then deduct this from the new total and set it to 0 again after each incremental update. Sounds like a lot of work though so no worries, I'll just do a full re-import occasionally. Or bug you again if a better idea ever pops into my head

Anyway, thanks again!

 

HOW TO: synchronise your last.fm playback stats with foobar

Reply #855
Hi marc, once again thanks for your continuous effort for this wonderful script.

As I had been away from foobar2k scene for some time now and was just updating all my plugins. I realized that the loved track and scrobbling feature no longer works. When clicking the loved icon, the following was displayed from the console:

Last.fm Playcount Sync: Attempting to love "JUICY" by "Koda Kumi"
Last.fm Playcount Sync: Contacting Last.fm....
Last.fm Playcount Sync: Track loved successfully.

But the fact is nothing seemed to be updated in last.fm.

I'm currently using WSH v.1.5.6

HOW TO: synchronise your last.fm playback stats with foobar

Reply #856
the scrobbling has nothing to do with me. you need foo_audioscrobbler for that.

the track loved successfully message is only shown when you get a very specific response from the last.fm servers saying that everything went ok.

how are you checking it? if the track has been recently scrobbled, you should see a heart icon next to it under recently listened tracks on your profile page. it should also appear under recent activity - also on your profile page. and when signed into last.fm, it should also show on the track page.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #857
the scrobbling has nothing to do with me. you need foo_audioscrobbler for that.

the track loved successfully message is only shown when you get a very specific response from the last.fm servers saying that everything went ok.

how are you checking it? if the track has been recently scrobbled, you should see a heart icon next to it under recently listened tracks on your profile page. it should also appear under recent activity - also on your profile page. and when signed into last.fm, it should also show on the track page.


I see. Finally I found the problem. It turned out that I removed the _DB in the foo_customdb very long time ago. So instead of %LASTFM_LOVED_DB% I was using %LASTFM_LOVED%. Changing the name in the common7.js and matching the Action name with 'Customdb ...' make everything works now. Sorry for such silly question.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #858
of course doing all that only affects what happens to the display in foobar and not on the website which is what you originally stated. 

unless you really meant inside foobar when you said this?

Quote
But the fact is nothing seemed to be updated in last.fm.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #859
Hey, how do albums like this work using sync?


They are all loaded with full musicbrainz information, and the songs are all actually called [untitled].

HOW TO: synchronise your last.fm playback stats with foobar

Reply #860
are they scrobbled? if you see them on your profile, the script should fetch them but they will all be counted as one because the script only uses the artist and title.


HOW TO: synchronise your last.fm playback stats with foobar

Reply #861
are they scrobbled? if you see them on your profile, the script should fetch them but they will all be counted as one because the script only uses the artist and title.


Any chance of adding the option of using more information, [mbid, trackid, length?] for building the playcount database?

HOW TO: synchronise your last.fm playback stats with foobar

Reply #862
although you can submit the album and MB trackid when using foo_audioscrobbler, there really is nothing to differentiate this information when fetching it back from them. like i said, it's limited to artist/title.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #863
although you can submit the album and MB trackid when using foo_audioscrobbler, there really is nothing to differentiate this information when fetching info back from them. like i said, it's limited to artist/title.


Okay, just thought I'd ask. Thanks.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #864
Do I get this right, this plugin does not work with defaul UI, right?

HOW TO: synchronise your last.fm playback stats with foobar

Reply #865
if you click back on your browser, you'll see it says something under the main thread title.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #866
Is there a way to love a song with a keyboard shortcut and have it automatically show up in foobar when you loved something?

So far I can either love a song in foobar and foo_softplaylists will send that to last.fm, but I have no way of displaying the love icon for this process in foobar

OR

I can set the custom DB LASTFM_LOVED_DB to 1, then I can display the little heart icon, but doing so won't send the info that I loved a track to last.fm.

Edit: I know that when playcount is updated so is the LASTFM_LVOED_DB, but that does not feel reliable at all.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #867
Quote
Edit: I know that when playcount is updated so is the LASTFM_LVOED_DB, but that does not feel reliable at all.


make sure you love the track before half of it is played. 

someone else ran into the same problem a page or two back and their solution was to create 2 keyboard shortcuts. i don't have anything better to suggest.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #868
I cannot find a consistent reason as to why, but the local playcount fails to update on my system 100% of the time.

Some tracks work, patterns arise and fall, and then tracks that were working stop working.

All I can say is that:
"Last.fm Playcount Sync: Contacting Last.fm...." only get's the "Last.fm Playcount Sync: Playcount updated successfully." once in a while, in no particular pattern.

I have no internet intense applications running, I'm not downloading anything.

I though that it had something to do with the length of path/file, but after 10 minutes of testing it failed to be consistent.


Is there anything I can do to supply information that might help?
I had written up a large post of filepath comparisons, but it turned out to have nothing to do with it.

I looked into the update_track function and saw that it only makes 3 attempts. Since last.fm takes a fair amount of time to initially load on my machine, could this be the problem?

HOW TO: synchronise your last.fm playback stats with foobar

Reply #869
Since last.fm takes a fair amount of time to initially load on my machine, could this be the problem?


not really sure what you mean by this? are you using the official last.fm scrobbler? if you are, you should pay attention to what i've put in the the readme.

Quote
1)   For scrobbling, I recommend Florian’s foo_audioscrobbler component found here:

http://www.mp3tag.de/en/fb2k.html

If you prefer the official Last.fm software, you need to access the Tools>Options>Scrobbling page and change it to at least 60%. The default of 50% conflicts with the way my script works. It’s far easier for people to change this setting than it is for me to implement support for both versions.


edit: are you using the stock foo_customdb .cfg file that i supply in the zip or do you have your own custom fields/actions as well?

HOW TO: synchronise your last.fm playback stats with foobar

Reply #870
I'm using foo_audioscrobbler 1.4.7.
I use your defaults for everything.

What I mean, when I say that last.fm takes a fair amount of time to load, is that when I load my home screen "http://www.last.fm/user/Zageron" it takes from 2-4 seconds before the page starts to load.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #871
i've updated the script to give a better of idea where it's failing. it now tells if the server response is ok but the update fails. it you still see no message then it means last.fm is not responding in a timely manner.

right click>Update script to get the latest version.

HOW TO: synchronise your last.fm playback stats with foobar

Reply #872
Last.fm Playcount Sync: Contacting Last.fm....
Last.fm Playcount Sync: Last.fm responded ok. Attempting to update playcount...
Last.fm Playcount Sync: Database error. Playcount not updated.

Haha.

What files should I delete in order to fix this.
I have done a redownload of my statistics numerous times, and this doesn't seem to fix it. So perhaps just completely delete your plugin from foobar and do a fresh drag-and-drop??

Thanks so much!

HOW TO: synchronise your last.fm playback stats with foobar

Reply #873
i must admit i don't know why that is happening. you haven't modified any files inside the marc2003 folder?

as i have no way to update the playcount cleanly from within foobar itself, i bundle an executable file called sqlite.exe (it's the official command line tool for working with sqlite databases which is what foo_customdb is based on). you mentioned earlier that it makes 3 attempts to run the command which updates the playcount. the reason it does this is because very occasionally the database goes get locked and it takes a 2nd attempt for it to work. during my own testing, i never saw it take more than 2 attempts which is why i set the limit to 3 just to be on the safe side. no one else has reported any problems so something else on your system might be interfering and blocking write access to the file but what that could be, i have no idea??? 

HOW TO: synchronise your last.fm playback stats with foobar

Reply #874
Well, I installed a fresh installation of foobar and reintegrated all of my components in a nice clean fashion.
The installation is fast and clean, and the customdb/wsh/sync components are all fresh downloads from their sources.
I imported the playcounts from the web, and I've successfully updated 5 songs in a row so far.

If I run into the problem again, I have a feeling it might possibly have something to do with my foobar installation being within my dropbox folder.
I'll let you know if I run into the problem again.

Thanks very much for the debug.