Skip to main content

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

0 Members and 1 Guest are viewing this topic.
  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #675
i'd check your system for nasties. getting the proxy changed like that is not good....

  • Zageron
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #676
Database entry update on mass scrobble?

When using foobar ipod manager it imports the play counts, audioscrobbler then scrobbles them on the next submit.
afaik the songs scrobbled this way do not update on your database.

Any chance of that?

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #677
i don't think this would be possible. i can fetch a user's entire last.fm library OR individual track details with user info. i don't have access to an ipod and even if i did, i believe it would be extremely cumbersome fetching info for a subset of tracks each time.

  • Nassoo
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #678
Hi marc,
I have a question... Is there an option to update the LastFM playcount info on loading a track in a playlist automatically? I often scrobble from my phone, and i'd like, if its possible, the foobar to update the info from lastFM without updating the whole database manually from Library import... Now actually it auto updates playcount only when the track plays for a few second (may be when scrobbles?).
Thank you in advance!

  • BrutuZ
  • [*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #679
Hi marc, couldn't help but notice the discussions about updating the database to sync with scrobbles from other devices. I too often scrobble from my Windows Mobile device, and got to admit it would be cool if I could sync just the last played tracks instead of the whole library.
Wouldn't it be possible then to perform an (optional) check on startup for the last, let's say, 50 scrobbled tracks and update the database accordingly by syncing track-by-track?
Perhaps just adding a menu item on the Un/Love Button do to it instead of / in addition to doing it automatically on startup would be better since it may be slow, but that's a matter of testing.

Since the API does provide the list of last played tracks (http://www.last.fm/api/show?service=278), it may be worth a shot.
  • Last Edit: 19 November, 2011, 11:14:19 PM by BrutuZ

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #680
i'm not keen on using that API because instead of getting the real playcount value, i'd have to keep running totals (given a track could appear multiple times) and then add the values to my database. i'd have no way to verify the final values are accurate - well other than making a list of artist/titles and sending an individual request to the trackinfo method for each one but that would be a bit crap....

i'll think about it.

  • for4saken
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #681
Hey marc, I've been using your scripts for a long time, but after upgrading WSH to 1.5.0 and your Last.fm script to the latest version something broke.

It's been a couple of weeks, I was waiting to see if anyone else had this problem or to a new version to be release; but since neither happened I'm writing for help.

It throws this error message: Scripting Engine Initialization Failed (Playcount Sync by marc2003, CODE: 0x80020101)

The relevant console log:
Code: [Select]
WSH Panel Mod ({AC02127E-FD87-4354-8BFE-673DB837A5D4}): Parsing file "C:\Users\for4saken\AppData\Roaming\foobar2000\marc2003\common.js"
WSH Panel Mod ({AC02127E-FD87-4354-8BFE-673DB837A5D4}): Parsing file "C:\Users\for4saken\AppData\Roaming\foobar2000\marc2003\tooltip_buttons.js"
WSH Panel Mod ({AC02127E-FD87-4354-8BFE-673DB837A5D4}): initialized in 16 ms
WSH Panel Mod (Playcount Sync by marc2003): Parsing file "C:\Users\for4saken\AppData\Roaming\foobar2000\marc2003\common4.js"
WSH Panel Mod (Playcount Sync by marc2003): Parsing file "C:\Users\for4saken\AppData\Roaming\foobar2000\marc2003\tooltip_buttons.js"
Error: WSH Panel Mod (Playcount Sync by marc2003): Erro em tempo de execução do Microsoft JScript:
O servidor de automação não pode criar objeto
File: C:\Users\for4saken\AppData\Roaming\foobar2000\marc2003\common4.js
Ln: 375, Col: 1
<source text only available at compile time>


The line in question: var vb = new ActiveXObject('ScriptControl');

Any other script of yours that imports common4.js fails with the same error.

I'm using a heavily customized version of MonolitePlus, which imports an old version of common.js and it's working.

Any help would be immensely appreciated.

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #682
if you clear the panel completely and have just this one line of code, i'm assuming it will also crash??

Code: [Select]
var vb = new ActiveXObject('ScriptControl');


if that's the case then there must be something wrong with your windows setup and i have no idea what that could be?  maybe some internet explorer security settings or files have been stripped away during a custom install?? i'm just guessing though....

that code is only required for the input dialogs so assuming you've already got your username and api key set, you could comment it out as a temporary workaround. the line following needs to be commented out also, like this...

Code: [Select]
//var vb = new ActiveXObject('ScriptControl');
//vb.Language = 'VBScript';


selecting any menu item that spawns an input dialog would also cause the panel to crash but for normal usage it should be fine.

  • for4saken
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #683
This workaround helped!

Thank you.

I cannot imagine what could be the problem, as I've said, I've been using your scripts for a couple years and besides updating WSH noting relevant changed system-wise.

I tried a clean foobar install, clean reinstall of the scripts; nothing.

That's why I've cried for help

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #684
updated: http://dl.dropbox.com/u/22801321/playcount%20sync.zip

added option to auto-updates submenu: only update tracks in library. the default is off (update all tracks) which is the current behaviour.

HOW TO: synchronise your last.fm playback stats with foobar
Reply #685
Hi Marc. Great script. Really well done. I was wondering, does the script still work if you remove the WSH Panel Mod panel? It's a little bit out of place in my foobar setup.

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #686
no, you can't remove the panel. how else would it work?

possible workarounds:
if using columns UI, you can highlight it in the layout tab and hide it.
using default UI, you could put in a tab that you rarely use.
again using default UI, you could put your whole layout in the top half of top/bottom splitter. then put the WSH panel in bottom half. it might look something like this....

http://dl.dropbox.com/u/22801321/lastfm%20...nt%20before.png

now drag the splitter down as far as it will go and you'll end up with this. you can notice a gap between the seekbar and status bar but i think it blends in well.

http://dl.dropbox.com/u/22801321/lastfm%20...unt%20after.png

you can then right click on the splitter and lock the bottom panel so it stays hidden even when resizing foobar.

edit: corrected columns UI instructions.
  • Last Edit: 23 January, 2012, 04:20:25 PM by marc2003

HOW TO: synchronise your last.fm playback stats with foobar
Reply #687
Did it by hiding in Columns UI. Perfect. Thanks.

  • radecke
  • [*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #688
edit: nevermind, had an outdated version of the wsh panel
  • Last Edit: 27 January, 2012, 11:45:58 AM by radecke
--> neugablonz.de ;)

  • lucidanime
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #689
updated: http://dl.dropbox.com/u/22801321/playcount%20sync.zip

added option to auto-updates submenu: only update tracks in library. the default is off (update all tracks) which is the current behaviour.


Just to report, I found a little issue with this version when used with Columns UI + ELPlaylist. Previously Loved tracks get unloved when the tracks Last.FM Playcount gets updated. To fix, just comment out the line "if (old_userloved == 1) fb.RunContextCommandWithMetadb("Customdb Love 0", g_metadb, 8);"in "function process() "

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #690
i didn't put that line in by mistake. i need to remove the record from the database before updating the playcount. i then set it back to loved straight away. i use ELplaylist myself and it always updates properly. if yours doesn't then you could try adding this at line 195:

Code: [Select]
fb.RunMainMenuCommand("View/ELPlaylist/Refresh");
  • Last Edit: 30 January, 2012, 12:33:14 AM by marc2003

HOW TO: synchronise your last.fm playback stats with foobar
Reply #691
Thanks a lot for this script Marc. I am usually not a person who posts on forums, but this time I just have to clarify how awesome this script is and why it beats stuff like playback statistcs.

In my honest opinion, playback statistics doesn't say anything about the amount of music you are listening to. Most of the people are listening to the music through their portable devices (mp3 player, smartphone, etc.). Due to this fact I spent a lot of time trying to synchronize my mp3 tags with the same mp3 files on my portable device.

After days of research I figured out, that the best method of synchronization is in using an online database. That also implies things like replacing old file tracks with some better quality ones without loosing the playcount. (I stored playcounts directly in mp3 tags)

So finally I found this thread and decided to give it a try. I have to admit that I had to replace my whole portable version of foobar to a new one. But after a clean setup it worked pretty well. Though in the beginning I was afraid of a following scenario:

Day 1: track A has 6 plays on my personal last.fm (last.fm = 6; custom_db = 0)
Day 2: after installing your script I am listening to track A one more time (last.fm = 7; custom_db = 7)
Day 3: durring the bus drive I am listening to track A for additional 2 times offline on my Sansa Clip+ with Rockbox. (last.fm = 7; custom_db = 7)
Day 4: I am uploading my last.fm scrobble listfile from my MP3 player to last.fm (last.fm = 9; custom_db = 7)
Day 5: I am listening to the track A at home using foobar (last.fm = 10; custom_db = 8?)

It is true that the track count is on 7 instead of the actual 10, but after playing the song one more time in foobar it retrives the correct playcount. (means including my mp3 player counts) After a couple of weeks I can still decide to import the whole last.fm data again, in order to display more accurate countvalues.

What I actually wanted to say - even though this thread seems to be pretty inconspicuous, it was the one and only solution for my picky perceptions of statistics. This way I can sort and play the best tracks on our flat parties according to my total overall listening experience.
  • Last Edit: 28 February, 2012, 03:04:06 PM by Cпутник

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #692
^glad you find it useful.

a little update.... http://dl.dropbox.com/u/22801321/playcount%20sync.zip

the icons can now be changed via the context menu. there is a choice of the original tango icon which is the same 32px in size and if you choose the silk icon, it will be 20px.



existing users, make sure the marc2003 folder gets extracted again so you get the required images - but people who use my other samples will already have them.

EDIT: i just re-uploaded to squish a little bug i introduced. this only applies to the new version from 30 minutes ago.
  • Last Edit: 28 February, 2012, 05:13:03 PM by marc2003

  • enigmatik
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #693
I'm runnig fb2k through WINE on Linux Mint 12 and I'm gettting this error on launch:



There is nothing in the console.

EDIT:

after I did "winetricks wsh56" i get the following:

Scripting Engine Initialization Failed (Playcount Sync by marc2003, CODE: 0x80020101)
Check the console for more information (Always caused by unexcepted script error).

from the console:


Error: WSH Panel Mod (Playcount Sync by marc2003): Microsoft JScript runtime error:
Automation server can't create object
File: Z:\media\4E362CDE362CC8B3\Dropbox\Applications\foobar2000-linux\marc2003\common4.js
Ln: 396, Col: 1

  • Last Edit: 01 March, 2012, 09:34:21 AM by enigmatik

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #694
here's an old post listing all the winetricks stuff i installed...

http://www.hydrogenaudio.org/forums/index....st&p=744005

  • enigmatik
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #695
Tried to do winetricks ie6 but it said it can't find it (broken link or something) so I did winetricks ie7 and all the rest on your list but still same error.

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #696
and you disabled safe mode in the WSH panel mod preferences?

  • enigmatik
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #697
Yes.

  • marc2003
  • [*][*][*][*][*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #698
in that case, i have no idea.

  • enigmatik
  • [*]
HOW TO: synchronise your last.fm playback stats with foobar
Reply #699
I actually did something wrong with ie... I'll report back.