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 383576 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 #225
@marc20003, I think I figured out the problem with the freezing when running the context menu items.  It has to do with the size of my music collection and thus the number of entries in the database.  Before, according to the customdb preferences page, there were well over 40000 entries in the database, and the file size was relatively large as well.  I tried all three of the options under the "tools" header (remove entries, vacuum), to little/no avail.  After upgrading to the latest version, deleting the now legacy %LFM_TH%, %LFM_H%, etc. fields, and re-running the tools, the number of items in my database is about 9500.  Now, when the database is updating, I notice little/no pause on my laptop, which typically froze for ~4 seconds.  Thanks for all of your help.

@n0obie4life, thanks for the code you posted earlier with the similar() function.  I managed to integrate this into my last.fm love/playcount sync script, and now everything works fine.  It was additionally helpful to dissect this and integrate it into my personal bio / artist art / similar artists scripts, which would typically produce poor results with some songs.  My personal library is tagged pretty well, but it's quite common for streaming radio to use poorly formatted (even misspelled) artist tags.  Thanks for discovering and sharing a good solution to this issue.

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

Reply #226
Quote
After upgrading to the latest version, deleting the now legacy %LFM_TH%, %LFM_H%, etc. fields, and re-running the tools, the number of items in my database is about 9500.


good idea. i'll add that to the "notes for upgraders" readme.

edit: version with updated documentation uploaded. but to save any existing sqlite users downloading it, this is what i added...

Quote
When you are satisfied that all your old playcounts have been transferred successfully, you can clean up the database by deleting the old values. Goto File>Preferences>Tools>Custom Database. Remove the following fields.

LFM_U
LFM_T
LFM_H
LFM_TH


On the Action tab, you can remove the Migrate Lastfm Playcounts entry. Restart foobar and then come back to the Custom Database preferences. On the Database tab, tick all 3 boxes under the Tool section and click Run.




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

Reply #227
has anybody had any issues with the very latest version sometimes leaving the playcount blank after an update? it's happened 3 times in the last hour after running perfectly for the last couple of days. most confusing.

if anybody has had this issue, they can update the script in their WSH panel with this....

http://pastebin.com/f2cb8a7c7

i've modified it to retry updating the playcount upto a maximum of 3 times. the most i've seen it take is 2 attempts. i've set it to output how many tries it takes to the foobar console.

Quote
Playcount sync: Contacting Last.fm....
Playcount sync: Last.fm responded 'OK'
1
2


edit: pastebin link updated.

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

Reply #228
I've seen this.  I fixed it by having the script check if the entry is blank every 5 seconds after the first update.

Code: [Select]
if (time > 15 && time % 5 == 0 && fb.TitleFormat("%LASTFM_PLAYCOUNT_DB2%").Eval() == "?") sync();

I've seen it take more than 3 tries.

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

Reply #229
Never had this issue, updated the script anyway.

Btw, is there any chance that you might include the "add_one" feature again? Right now I edit it in myself, but am wondering why you removed it.

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

Reply #230
@Hitchhiker427, perhaps you should try my update. there's no need to fetch the data from last.fm repeatedly.  mine retries instantly. you can always modify how many attempts it takes if 3 isn't enough. (line 108)

@Cabalist, i was too lazy to implement that option when i switched everything over to be set via the context menu instead of having people edit the scripts. i might put it back in at some point.

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

Reply #231
Ok, I'll give it a shot.  Yeah, fetching the data every retry is pretty inefficient.

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

Reply #232
i'd be interested to see the maximum number of retries attempts needed. during my testing i've only needed a 2nd attempt. just check your console every now and then.

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

Reply #233
The highest number I've seen so far, was a one.
I will continue to look at the console.

thanks

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

Reply #234
just to clarify, the number in the console is the number of attempts, not retries. it should always show 1 when it's working as normal. sorry for the confusion.

 

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

Reply #235
Quote
i'd be interested to see the maximum number of retries  attempts needed.

Played music for nearly 8 hours after updating your script, never needed more than 1 attempt to update the playcount according to the console output.

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

Reply #236
thanks.... but you did say you never had the problem originally...

anyway

new main version uploaded

-hopefully fix the issue of playcounts not being updated in the previous version. (just the new "playcount sync.txt" needs to be imported)
-updated documentation so people who use foo_customdb for other purposes can manually update their database to work with this script. this was impractical with earlier versions because i had over 40 entries. now there are just 5.

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

Reply #237
Thanks for this, I'm just so happy to not rely last.fm app any longer. It works great!


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

Reply #239
yep, noticed that yesterday (thanks to Yirkha's update component). i've already bundled it into the download.

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

Reply #240
I am here to ask for help again

I'm a fool and updated playcount sync despite it working perfectly for me already--and of course, in updating, everything broke. Duh... Lesson learned: never update something unless your current version is buggy or missing features that you need.

Anyway, I managed to restore almost everything using the playcount sync old.zip file that you graciously provided (thank you for that! I was an even bigger idiot and overwrote the old script I had), but I still have one minor thing that is really driving me up the wall:


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

Reply #241
well it's not the script because even if you clear it, the panel still won't resize as small as it used to. 

edit: a possible workaround is to hide the toolbars and then create your own horizontal splitter with the columns UI toolbars in. that way, you can resize the WSH panel.

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

Reply #242
That's a good workaround, thanks!

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

Reply #243
I made a couple small changes.

lines 142-3, 147-48
Code: [Select]
          
            if (api_key != null) {
                on_metadb_changed();
                window.NotifyOthers("lastfm_update", 1);
            }


Otherwise it throws a script error if you hit the cancel button with an empty input box.

in on_metadb_changed():

Code: [Select]
        case (fb.TitleFormat("$strcmp($left(%path%,7),'http://')").EvalWithMetadb(g_metadb) != 0):
            n = "love.png";
            h = "exclamation_h.png";
            tooltip = "Unable to love!";
            func = null;
            break;


Disable on radio streams since softplaylists doesn't seem to work with dynamic metadata. Not the best way to do it probably but it works.

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

Reply #244
Otherwise it throws a script error if you hit the cancel button with an empty input box.


i can't re-produce that. cancelling the input boxes even when empty doesn't cause any problems here. can you elaborate? i assume the script was un-modified before you noticed this?

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

Reply #245
I can't reproduce it anymore either, but oddly enough it happened every time on the RC of Windows 7. I didn't bother to try it on the release version because I had no idea that it would make a difference, sorry about that.

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

Reply #246
Does this script use foobar2000 proxy setting?
I can't fetch anything being behind proxy.
No related messages in console, no errors.
All other internet-related components work fine.

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

Reply #247
as it's using ActiveX objects, i'd assume that it uses Internet Explorer's proxy settings.

i honestly don't know for sure though. maybe someone more knowledgeable will read your post and be able to answer that for you.

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

Reply #248
According to last.fm I have 1,025 Loved Tracks, but I got only 432 in playlist.
Is there some limitation in last.fm or soft playlists component?

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

Reply #249
Nice plugin, I like it very much.

However, there is a small annoyance that happens in my case at least. Every time when you listen to track you have scrobbled at least once and when the plugin syncronizes stats with Last.fm (while music is playing), there is a very small pause -  taskbar icon even shows message "unpaused" when this happens. Is there any way to get rid of this, since it cuts music during this duration and is clearly audible?

My foobar version is 1.0 and the plugin components are those that are currently in the first post's zip-file.