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 386837 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

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

Reply #325
Hm, that's fine. I guess unlucky for me I may keep getting crashes. Thanks for the reply, heh.

Just a hint, check all custom db action if they are mapped to an existing field.
I noticed crashes when an action (like Media Library (Modified)) tried to update a field which not exist anymore.


Just going to ask dumb questions since I am not sure.
Tools -> Custom Database -> Fields
Those fields, you mean? I think these are mapped, but beyond that, I'm not sure. Well, maybe more under the Action tab. Since I haven't editted anything in Custom Database, I think I may be unfortunate. I  just replaced the old .cfg with the one marc provided, but I think I was already using it. Just doing it to see if foobar will crash again now.

Anyways, it doesn't seem like it will crash. It usually would have crashed by now unless there is something more to what's making it crash.

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

Reply #326
First of all, I'd like to thank marc2003 for this wonderful script!

I was just wondering if it would be also possible to get total plays of album and artist somehow from last.fm to database? (for example, it would be something like "Bob Dylan (100 plays) / Blonde on Blonde (75 plays) / Just like a woman (10 plays))

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

Reply #327
it's certainly possible to get that info from last.fm. whether i can be bothered to implement it is another thing entirely.

i'll think about it.

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

Reply #328
Hi.
Can i get some help with this great script. After i install it and do all the instructions, i don't have any playcounts, as well as in track properties there is no "LASTFM_PLAYCOUNT_DB", it works only for loved tracks, but track shows to be loved only after it was played about 50% (or it is supposed to be so?) And btw, playcounts should appear immediately or after playing track too?
When i pressed "Create and import SQL file" it showed  in console requests the script made.  Several times I tried installing this script every time precisely following instructions but still it doesn't work    I even made a clear install of Foobar with only column_ui, but still i get the same - no playcounts, only shows loved tracks. When playing song i can see the following in console:
Code: [Select]
Watching: F:\
WSH Panel Mod (GUID: FA707B22-3808-4B06-ACEF-725BF60B027B): Parsing file "C:\Program Files\foobar2000\scripts\marc2003\v2\common.js"
WSH Panel Mod (GUID: FA707B22-3808-4B06-ACEF-725BF60B027B): Parsing file "C:\Program Files\foobar2000\scripts\marc2003\v2\tooltip_buttons.js"
Custom Database: Initialize
Custom Database: table quicktag already exists (1)
Custom Database: table database_version already exists (1)
Custom Database: index url_idx already exists (1)
Custom Database: Completed
WSH Panel Mod (GUID: FA707B22-3808-4B06-ACEF-725BF60B027B): initliased in 0.0000278 s
Filter Panel - Genre: initialised in 0.010 s
Filter Panel - Artist: initialised in 0.071 s
Filter Panel - Album: initialised in 0.075 s
Startup time : 0:00.937253
Properties dialog refresh: 0:00.000049
Properties dialog display refresh: 0:00.001912
Opening track for playback: "F:\Mylène Farmer\2001 - Les Mots\09 - Je Te Rends Ton Amour.mp3"
Properties dialog refresh: 0:00.000045
Properties dialog display refresh: 0:00.001920
Playcount sync: Contacting Last.fm....
Playcount sync: Last.fm responded 'OK'

I have no ideas why it doesn't work 

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

Reply #329
Hi Marc,
first thanks for this script.

I have an idea for the damn auto correction at Last.fm: how about adding two tags to our files, maybe LASTFM_ARTIST and LASTFM_TITLE, where we could store the artist and title just like Last.fm expects us to.
My problem is that turning off the correction is not an option. And since my differences are mainly in the titles the workaround posted in this thread is not working either . I hate having the "(feat. ...)" in my titles but Last.fm sometimes redirect to these titles.

I hope this could somehow be implemented because it would solve my problem () and the problem with foreign names.

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

Reply #330
additional tags? i don't think so. that would be a usability nightmare.

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

Reply #331
Besides the tag bloat for those who have the tags set according to lfm and/or don't mind having a few tracks displaying only the default DB playcount.


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

Reply #333
Since it was a pretty small change I did it by myself .

Just change the following lines in on_metadb_changed()
Code: [Select]
    artist = fb.TitleFormat("%artist%").EvalWithMetadb(g_metadb);
    track = fb.TitleFormat("%title%").EvalWithMetadb(g_metadb);


to
Code: [Select]
    artist = fb.TitleFormat("$if2(%lastfm_artist%, %artist%)").EvalWithMetadb(g_metadb);
    track = fb.TitleFormat("$if2(%lastfm_title%, %title%)").EvalWithMetadb(g_metadb);


Now it will get the artist and title out of the LASTFM_ARTIST and LASTFM_TITLE tags if they are present.

But remember that this method is only working with live syncronization and not with the script that updates your complete library.

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

Reply #334
for anybody still having problems getting this to work, i've bodged together a video showing the complete install process:

http://cid-649d3bfeaf541fbb.skydrive.live....obar/foobar.wmv (15.7 MB)

(i forgot to install full font support for the ♥ but that's not really important for this)

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

Reply #335
Yo Marc, I recall awhile back you talking about implementing some sort of script that could grab more than 1000 loved tracks from last.fm (like soft playlists)... Do you still have any plans of doing this? Just curious.

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

Reply #336
i did that ages ago.

new version uploaded

http://cid-649d3bfeaf541fbb.skydrive.live....ount%20sync.zip

-imports loved track status automatically at the same time as playcount. there are no limits to the number of loved tracks. unfortunately this has a required an update to the db structure so existing users (since the import script update) will need to delete their database and overwrite foo_customdb.dll.cfg again and of course import the new playcount sync.txt into their WSH panel.


i used your account for testing because i don't know anyone else with more than 1000 loved tracks.


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

Reply #338
Would it be possible to submit the tracks played with foo_upnp to lastfm as well?

The latest version of foo_upnp now uses foo_playcount so maybe that opens up some possibilities.... 

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

Reply #339
you're in the wrong thread. this has nothing to do with submissions.


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

Reply #341
GREAT THANK YOU FOR FULL STATISTICS IMPORT FEATURE!

And little question: can I "love" tracks with DUI toolbar button instead of WSH panel button??
🇺🇦 Glory to Ukraine!

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

Reply #342
the "love track" feature is provided by foo_softplaylists so you can create a DUI toolbar button to do just that.


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

Reply #343
Similar problem but no idea if loved tracks works either since I don't have any.
I'm trying to use [%LASTFM_PLAYCOUNT_DB%] with elplaylist and wshpanel but nothing is returned.

Hi.
Can i get some help with this great script. After i install it and do all the instructions, i don't have any playcounts, as well as in track properties there is no "LASTFM_PLAYCOUNT_DB", it works only for loved tracks, but track shows to be loved only after it was played about 50% (or it is supposed to be so?) And btw, playcounts should appear immediately or after playing track too?
When i pressed "Create and import SQL file" it showed  in console requests the script made.  Several times I tried installing this script every time precisely following instructions but still it doesn't work    I even made a clear install of Foobar with only column_ui, but still i get the same - no playcounts, only shows loved tracks. When playing song i can see the following in console:
Code: [Select]
Watching: F:\
WSH Panel Mod (GUID: FA707B22-3808-4B06-ACEF-725BF60B027B): Parsing file "C:\Program Files\foobar2000\scripts\marc2003\v2\common.js"
WSH Panel Mod (GUID: FA707B22-3808-4B06-ACEF-725BF60B027B): Parsing file "C:\Program Files\foobar2000\scripts\marc2003\v2\tooltip_buttons.js"
Custom Database: Initialize
Custom Database: table quicktag already exists (1)
Custom Database: table database_version already exists (1)
Custom Database: index url_idx already exists (1)
Custom Database: Completed
WSH Panel Mod (GUID: FA707B22-3808-4B06-ACEF-725BF60B027B): initliased in 0.0000278 s
Filter Panel - Genre: initialised in 0.010 s
Filter Panel - Artist: initialised in 0.071 s
Filter Panel - Album: initialised in 0.075 s
Startup time : 0:00.937253
Properties dialog refresh: 0:00.000049
Properties dialog display refresh: 0:00.001912
Opening track for playback: "F:\Mylène Farmer\2001 - Les Mots\09 - Je Te Rends Ton Amour.mp3"
Properties dialog refresh: 0:00.000045
Properties dialog display refresh: 0:00.001920
Playcount sync: Contacting Last.fm....
Playcount sync: Last.fm responded 'OK'

I have no ideas why it doesn't work 


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

Reply #344
first thing to check, right click any track in your playlist and look under "Legacy commands (unsorted)". does it have 4 customdb related commands like this screenshot?



if not, then you didn't place the foo_customdb.dll.cfg file in the correct place. check the manual again making sure foobar isn't running while you do it.

if this looks ok then tell me exactly what you've done and where you're stuck at.

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

Reply #345
Woops, sorry about that.
I thought I had placed it in my foobar appdata config folder but that was actually the autogenerated foo_customdb.dll.cfg. it works now.

Thanks

first thing to check, right click any track in your playlist and look under "Legacy commands (unsorted)". does it have 4 customdb related commands like this screenshot?



if not, then you didn't place the foo_customdb.dll.cfg file in the correct place. check the manual again making sure foobar isn't running while you do it.

if this looks ok then tell me exactly what you've done and where you're stuck at.


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

Reply #346
so unluckily, the customdb_sqlite.db didn't update for me and after testing random things, I found out the file wouldn't, so I moved the old one and let a new one take its place it updated fine, but besides the

Quote
There is a 2nd context menu item labelled “Import SQL file”. This is a precautionary option that hopefully you won’t have to use. It’s only there in case the database update fails and it means you don’t have to download the data all over again.


is there a way to import the playlist count from the non-updating customdb? I noticed some files don't have the LASTFM_PLAYCOUNT_DB count when I imported them, but maybe it is because it's not correctly updating for me.

Quote
Couldn't load foo_custominfo DB: Playback Statistics Custom (0x0007)
Playcount sync: Contacting Last.fm....
Playcount sync: Contacting Last.fm....
Playcount sync: Last.fm responded 'OK'
Playcount sync: Playcount not updated. No changes found.
Playcount sync: Last.fm responded 'OK'
Playcount sync: Playcount not updated. No changes found.


Something is so messed up for me.. and it doesn't update counts after I restart foobar.

---

I may as well keep the old post. I guess it was my PlaybackStatistics.dat, so I just renamed it and let a new one be made. Yet, it seems eventually it stops updating. Eh, is my only option to delete the PlaybackStatistics.dat and customdb_sqlite.db?

---

It seems like it only adds the playcount once and it no longer updates which is the Playcount sync message, I guess. Could I have accidentally changed something to limit the update count to only count once?

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

Reply #347
PlaybackStatistics.dat is used by foo_playcount. it has nothing to with this at all.

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

Reply #348
PlaybackStatistics.dat is used by foo_playcount. it has nothing to with this at all.


Okay, just ignoring all of what I posted. Know any reason why it won't update if it has at least 1 lastfm_playcount? I am just.. unaware why it does this. This is basically all I would like to find out.

and possibly 'Couldn't load foo_custominfo DB: Playback Statistics Custom (0x0007)' that message. Even though it does update, and has in the past.. maybe it doesn't really mean anything.

Anyways, any answers are appreciated, or even anything, heh.

---
edit: maybe weird, but I don't know what changed besides using the 1.4.7 audio scrobbler instead of this 2.3.1 version I was using, but it seems fine updating now.

Double edit: maybe it doens't. Some tracks update and others don't. Maybe only tracks actually on last.fm or ones with the exact artist / title / album? Not sure, but it worked before. another problem to bother me.

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

Reply #349
foo_custominfo is also completely unrelated. this script uses foo_customdb.