Skip to main content

Topic: HOW TO: synchronise your last.fm playback stats with foobar (Read 267719 times) previous topic - next topic

0 Members and 2 Guests are viewing this topic.
  • salamich
  • [*]
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.

  • marc2003
  • [*][*][*][*][*]
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.
  • Last Edit: 21 May, 2013, 12:36:56 PM by marc2003

  • salamich
  • [*]
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.

  • marc2003
  • [*][*][*][*][*]
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.
  • Last Edit: 21 May, 2013, 04:43:21 PM by marc2003

  • salamich
  • [*]
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!

  • D.Sync
  • [*][*][*]
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

  • marc2003
  • [*][*][*][*][*]
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.
  • Last Edit: 24 May, 2013, 06:20:35 AM by marc2003

  • D.Sync
  • [*][*][*]
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.
  • Last Edit: 24 May, 2013, 09:49:30 AM by D.Sync

  • marc2003
  • [*][*][*][*][*]
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.
  • Last Edit: 24 May, 2013, 10:03:45 AM by marc2003

  • Zageron
  • [*]
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].

  • marc2003
  • [*][*][*][*][*]
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.


  • Zageron
  • [*]
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?

  • marc2003
  • [*][*][*][*][*]
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.
  • Last Edit: 31 May, 2013, 03:10:06 PM by marc2003

  • Zageron
  • [*]
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.

  • Calebzor
  • [*]
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?

  • marc2003
  • [*][*][*][*][*]
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.
  • Last Edit: 01 June, 2013, 12:41:23 AM by marc2003

  • Calebzor
  • [*]
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.
  • Last Edit: 01 June, 2013, 05:51:54 AM by Calebzor

  • marc2003
  • [*][*][*][*][*]
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.

  • Zageron
  • [*]
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?
  • Last Edit: 09 June, 2013, 05:41:24 PM by Zageron

  • marc2003
  • [*][*][*][*][*]
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?
  • Last Edit: 09 June, 2013, 07:08:11 PM by marc2003

  • Zageron
  • [*]
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.

  • marc2003
  • [*][*][*][*][*]
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.

  • Zageron
  • [*]
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!
  • Last Edit: 11 June, 2013, 01:26:55 AM by Zageron

  • marc2003
  • [*][*][*][*][*]
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??? 

  • Zageron
  • [*]
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.