Skip to main content

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

0 Members and 1 Guest are viewing this topic.
  • ubercow
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #875
Hi marc

Could you elaborate on something please...if I love a track from the last.fm interface and then want the track's loved status to be updated in my library to reflect this, when exactly does this happen? If I play the song, will the loved status be fetched from the website and overwrite whatever status the track has in my database? At what point does this happen on playing the song, at the beginning or in the middle when the track would be scrobbled?

I have a feature request too, would it be possible to have separate menu options for just fetching the loved tracks again from the site, and the playcounts, and both? Playcount fetching takes quite a while and it would be nice to update just my loved tracks when I think they are out of sync, as the exact value of playcounts somehow seems less important to keep strictly up to date.

Thanks!

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #876
Quote
If I play the song, will the loved status be fetched from the website and overwrite whatever status the track has in my database?


yes. but it would only get the new loved status when enough of it has been played to count for a scrobble.

if you know you've loved tracks via the website, you can update the local database by right clicking track(s) in the playlist and selecting Legacy Commands (unsorted)>Customdb Love 1.

i can split the import to let you get just the loved tracks. i'll post an update later.
  • Last Edit: 24 June, 2013, 05:40:03 AM by marc2003

  • ubercow
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #877
yes. but it would only get the new loved status when enough of it has been played to count for a scrobble.

i can split the import to let you get just the loved tracks. i'll post an update later.


Okay I thought so. Is this because the process is tied to the scrobbling process in any way or is it just so that the playcount is updated to include the current scrobble after it happens?

That's super thank you very much! 

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #878
right, there are now 2 options under Library import. there is now loved tracks and playcount which works the same as before. and there is now loved tracks only. i didn't think there was much point making a playcount only option.

right click>Update script.

edit: to answer your post which wasn't there when i started typing....it's just the way my script works. it could fetch the loved status at the beginning of a track. i just choose to update when enough of the track has been played for a scrobble. this is because i generally don't use anything external to foobar for scrobbling/loving tracks.
  • Last Edit: 24 June, 2013, 07:28:32 AM by marc2003

  • ubercow
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #879
Works wonderfully, thank you.

I was just unsure what it was necessary to do after loving a track elsewhere but that makes perfect sense, seems like the best way to do it. It's nice and quick to update everything anyway now if I am unsure everything is synced

  • Shizukasm
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #880
First of all thanks a lot for your wonderful script and for your continued support, seriously! I have playback statistics configured here to always save statistics to file after changing them (so, for instance, if I rate the song it will add this in metadata form to the mp3, it also updates PLAYCOUNT with each play). What I would like to do is write %LASTFM_PLAYCOUNT_DB% to the metadata instead, is it possible?

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #881
it used to be fairly easy to make that change with older versions of my script but i don't keep those any more. with all my recent changes, it's a lot more messy now and it's not so easy to modify. 

edit: i have found an older backup which should be easier to modify. i'll post that up later on.
  • Last Edit: 27 June, 2013, 08:03:40 AM by marc2003

  • Shizukasm
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #882
it used to be fairly easy to make that change with older versions of my script but i don't keep those any more. with all my recent changes, it's a lot more messy now and it's not so easy to modify. 

edit: i have found an older backup which should be easier to modify. i'll post that up later on.

Ahh great news! Thanks a lot.

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #883
do you need it to love tracks as well or are you only interested in playcount?

i would have done it before now but i've been "busy" watching wimbledon all week.

  • Shizukasm
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #884
do you need it to love tracks as well or are you only interested in playcount?

i would have done it before now but i've been "busy" watching wimbledon all week.


I'm only interested in playcount.

Haha, don't worry too much, I'm grateful enough that you did the script already! Do it whenever you have time =)

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #885
that makes it much easier for me and there is no play tomorrow so i'll do it then.

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #886
here you go: https://dl.dropboxusercontent.com/u/2280132...count%20tag.txt

just stick that in a panel. there is nothing to click so it's just a grey background to match the default splitter colour. there are a few options on the right click menu. once you've done that, you can resize it to hide it.

to give yourself, a head start, you can transfer all values already in foo_customdb in to your file tags. simply select a bunch of files>right click>properties. now right click the playcount tag you want to store values in and then format from other fields. in the pattern dialog, enter

Code: [Select]
[%LASTFM_PLAYCOUNT_DB%]
  • Last Edit: 30 June, 2013, 06:41:12 AM by marc2003

  • Shizukasm
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #887
here you go: https://dl.dropboxusercontent.com/u/2280132...count%20tag.txt

just stick that in a panel. there is nothing to click so it's just a grey background to match the default splitter colour. there are a few options on the right click menu. once you've done that, you can resize it to hide it.

to give yourself, a head start, you can transfer all values already in foo_customdb in to your file tags. simply select a bunch of files>right click>properties. now right click the playcount tag you want to store values in and then format from other fields. in the pattern dialog, enter

Code: [Select]
[%LASTFM_PLAYCOUNT_DB%]


Hugeee thanks Marc, works perfectly

HOW TO: synchronise your last.fm playback stats with foobar
Reply #888
Instead of importing my loved tracks from last.fm, can I do a batch export?  Let's say I want to love all the tracks from three albums, but I don't have the time to listen to them all so they're scrobbled.  Instead, I play a few seconds of each track, and love them all using your script.  How can I update last.fm with these new tracks?

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #889
not really sure what you mean? if you love a track, it will appear in your last.fm library. you don't have to scrobble it for it to show. it just won't have any plays attached it.

HOW TO: synchronise your last.fm playback stats with foobar
Reply #890
not really sure what you mean? if you love a track, it will appear in your last.fm library. you don't have to scrobble it for it to show. it just won't have any plays attached it.


I tested this with a track that I had verified was not loved on last.fm.  I played it very briefly and loved it using your script.  Then I played it again, in full, so that it would be scrobbled, and as soon as it was, the loved status disappeared. 

I'd like to be able to love a large number of tracks locally and then have that information synced to last.fm, but it seems that the last.fm status overrides any change I make locally.  Does that make sense, or am I not explaining myself correctly?

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #891
I played it very briefly and loved it using your script.


this should update last.fm immediately and the local database only updates when you get a successful response from last.fm. you should see success/failure messages in the console. also, right click a track in the playlist>properties>properties tab. you should see a Custom database section under the tech info.

if you wanted to love numerous tracks quickly then the best bet would be to actually stop playback. select a track, love it, wait for response. select another track, love it, wait and so on. (and when i say wait - it may take a second or 2 at most)

Quote
Then I played it again, in full, so that it would be scrobbled, and as soon as it was, the loved status disappeared.


i don't see how this could happen. the loved status would not update locally if there was no success response from last.fm. then when you play the track, the only way the loved status could disappear is if the response during the auto-update was that the track is not loved????

are you using the latest version of my script downloaded from this thread? it's not some modified version you found elsewhere? you can also check to see tracks that are loved on the recent activity section of your last.fm profile. you'll find this on the top right of your profile page.

HOW TO: synchronise your last.fm playback stats with foobar
Reply #892
Yes, I am using the script from this thread, and yesterday I updated it from within foobar.  I tried doing another import of both loved tracks and playcounts, hoping to start fresh, but there are still some tracks that show they are loved in foobar which are not present on last.fm.  How can I clear the local database so when I perform a sync, there should be no discrepancies?

Edit - Also, I think the issue began when I started using a global hotkey to love and unlove tracks.  I see in the console that using the hotkey, while it does apparently set the "customdblove" value to 1, there is actually no communication to last.fm  However, if I click on the heart icon, the request is sent to last.fm correctly.
  • Last Edit: 02 July, 2013, 10:33:56 AM by flvinny521

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #893
well you've discovered the problem by yourself. those context menu items are only there for my script to update the local database. they are only supposed to be triggered by my script when loving/unloving tracks via the button or during playback when enough of the track has played to count for a scrobble.

triggering them via hotkeys only updates the local database and bypasses my script completely.

the database file is named customdb_sqlite.db in your foobar2000 profile folder if you want to delete it and start again.
  • Last Edit: 02 July, 2013, 11:00:00 AM by marc2003

HOW TO: synchronise your last.fm playback stats with foobar
Reply #894
well you've discovered the problem by yourself. those context menu items are only there for my script to update the local database. they are only supposed to be triggered by my script when loving/unloving tracks via the button or during playback when enough of the track has played to count for a scrobble.

triggering them via hotkeys only updates the local database and bypasses my script completely.

the database file is named customdb_sqlite.db in your foobar2000 profile folder if you want to delete it and start again.


Thanks for your help; seems like everything is working as it should.

  • Kanapka
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #895
It's probably stupid question, but... Where I can find Library import? :|

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #896
you need to right click the actual heart icon to get the full menu.

  • Kanapka
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #897
Thanks. Now I've got another problem. Why this script doesn't synchronizes all of my ~20000 plays, but reaches ~4200, and then stops? Example of problem:


Console after finished syncing:


Thanks in advance, and sorry for my English. I know it's terrible.

HOW TO: synchronise your last.fm playback stats with foobar
Reply #898
Thanks. Now I've got another problem. Why this script doesn't synchronizes all of my ~20000 plays, but reaches ~4200, and then stops? Example of problem

Looks as if it synced everything. Some tracks were played multiple times.

  • Kanapka
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #899
Thanks. Now I've got another problem. Why this script doesn't synchronizes all of my ~20000 plays, but reaches ~4200, and then stops? Example of problem

Looks as if it synced everything. Some tracks were played multiple times.



Some of albums, that I don't listened to in a long time, are synchronizing only when I scrobble them. Example:

(before listening to whole album)


(after)

EDIT:
It's probably because of last.fm who corrects artist tag from "Snoop Doggy Dogg" to "Snoop Dogg". I'm sorry, my fault
  • Last Edit: 03 August, 2013, 05:41:31 AM by Kanapka