IPB

Welcome Guest ( Log In | Register )

41 Pages V  « < 7 8 9 10 11 > »   
Reply to this topicStart new topic
HOW TO: synchronise your last.fm playback stats with foobar, ...works with CUI and DUI
acmodeu
post Feb 13 2010, 23:34
Post #201





Group: Members
Posts: 84
Joined: 28-September 07
From: Petrozavodsk
Member No.: 47418



QUOTE (marc2003 @ Feb 14 2010, 00:35) *
@acmodeu, does your "legacy commands (unsorted)" context menu look like this?

screenshot

if it doesn't, you haven't followed the instructions properly.

also check the "properties" tab of the the file's properties to see if there are any customdb entries (also illustrated in the above screenshot).

Yep, my context menu looks the same, but I've turned it off in the context menu. Shouldn't I? My properties doesn't have such fields. Should I do smth with library?
Go to the top of the page
+Quote Post
acmodeu
post Feb 13 2010, 23:44
Post #202





Group: Members
Posts: 84
Joined: 28-September 07
From: Petrozavodsk
Member No.: 47418



Seems like I've finally made it work. smile.gif Is it right that the thing does not work with legacy commands hidden? And is there a chance for this stuff to work without wsh panel present in the interface because I have to hide them in 1x1 pixel?

This post has been edited by acmodeu: Feb 14 2010, 00:24
Go to the top of the page
+Quote Post
Hitchhiker427
post Feb 14 2010, 00:28
Post #203





Group: Members
Posts: 232
Joined: 11-December 09
Member No.: 75848



QUOTE (marc2003 @ Feb 13 2010, 16:29) *
when you say freeze, how bad is it? does it affect windows as a whole when foobar is minimised? like i said before, if i stare at a visualisation, i'll notice it stutter but it doesn't cause the UI to freeze and certainly isn't noticeable under normal conditions. i only have a lowly pentium dual core and i'm guessing most other people don't have hardware as powerful as yours. i think you're the first person to report any such issues???


It doesn't affect Windows as a whole, but it does affect the foobar2000 UI. So yes, visualizations stutter, the progress bar stutters, the playback time freezes, I can't click on anything, and I can't input text. Additionally, the audio output is completely unaffected, it's just the UI that has problems.

My laptop (Core 2 Duo) will freeze when the playback time is at 0:10, and resumes at 0:14. My desktop, as I mentioned earlier, freezes for about 2 seconds.

So far, my personal modification is working for the most part, and the stutter is less than a second per update. It really seems like this is a customdb problem, but that doesn't seem to be updated often.
Go to the top of the page
+Quote Post
Hitchhiker427
post Feb 14 2010, 00:30
Post #204





Group: Members
Posts: 232
Joined: 11-December 09
Member No.: 75848



QUOTE (acmodeu @ Feb 13 2010, 16:44) *
Seems like I've finally made it work. smile.gif Is it right that the thing does not work with legacy commands hidden? And is there a chance for this stuff to work without wsh panel present in the interface because I have to hide them in 1x1 pixel?


WSH Panel Mod can only run non-hidden context menu items. I've requested that this be fixed, so hopefully if T.P Wang has time he'll get to it.
Go to the top of the page
+Quote Post
acmodeu
post Feb 14 2010, 00:42
Post #205





Group: Members
Posts: 84
Joined: 28-September 07
From: Petrozavodsk
Member No.: 47418



QUOTE (Hitchhiker427 @ Feb 14 2010, 02:30) *
WSH Panel Mod can only run non-hidden context menu items.
Oh, so that was the reason of troubles. laugh.gif Yeah, that definitely should be fixed.
Go to the top of the page
+Quote Post
marc2003
post Feb 14 2010, 01:02
Post #206





Group: Members
Posts: 4464
Joined: 27-January 05
From: England
Member No.: 19379



i have a new test version that i need guinea pigs to try. this has just 4 entries on the context menu. blink.gif

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

please only try this if you already have the previous version working already.

instructions.

extract sqlite3.exe into your foobar program directory
make sure foobar is closed and overwrite foo_customdb.dll.cfg in your configuration folder with this new one.
import the new .txt into your WSH panel

now you need migrate all your old playcounts across (library search> %LFM_U% PRESENT ). right click all files and select Migrate Lastfm Playcounts on the legacy commands (unsorted) context menu

finally update your playlist column to show %LASTFM_PLAYCOUNT_DB2% - this is where the playcounts are now going to be stored.

This post has been edited by marc2003: Feb 14 2010, 01:05
Go to the top of the page
+Quote Post
unclean
post Feb 14 2010, 01:52
Post #207





Group: Members
Posts: 51
Joined: 23-January 10
Member No.: 77440



I had to comment out line 179 to get it working, but other than that and win7 barfing up a security prompt for the sql database it's great so far, thanks!
Go to the top of the page
+Quote Post
marc2003
post Feb 14 2010, 02:03
Post #208





Group: Members
Posts: 4464
Joined: 27-January 05
From: England
Member No.: 19379



new beta uploaded - old version only worked on portable installs. it should now work on standard installs as well. same link as above.

This post has been edited by marc2003: Feb 14 2010, 02:04
Go to the top of the page
+Quote Post
Hitchhiker427
post Feb 14 2010, 02:12
Post #209





Group: Members
Posts: 232
Joined: 11-December 09
Member No.: 75848



Marc, you're my hero. This fixed up my issue quite well and so far works fine. I had to change the path to the customdb_sqlite.db file because it's stored in my profile folder rather than the program folder, but other than that I'm happy. Is this change I mentioned all that was fixed in the latest beta (portable vs. standard install), or is there any other reason I should upgrade? Thanks again.

I'll let you know if I encounter any new problems.
Go to the top of the page
+Quote Post
marc2003
post Feb 14 2010, 02:19
Post #210





Group: Members
Posts: 4464
Joined: 27-January 05
From: England
Member No.: 19379



yes that was the exact issue. this is the change i made (line 106)

CODE
WshShell.Run("sqlite3.exe \"" + fb.ProfilePath + "\\\"customdb_sqlite.db " + query1, 0, true);


edit: only just noticed this.. tongue.gif

QUOTE (unclean @ Feb 14 2010, 00:52) *
I had to comment out line 179 to get it working, but other than that and win7 barfing up a security prompt for the sql database it's great so far, thanks!


line 179? that just draws the background?? i'll have to investigate the security prompt thing. i use windows 7 and don't see it - maybe it's because i'm using an admin account. i'll do some more testing.

This post has been edited by marc2003: Feb 14 2010, 02:34
Go to the top of the page
+Quote Post
dalover
post Feb 14 2010, 02:35
Post #211





Group: Members
Posts: 16
Joined: 8-February 10
Member No.: 77990



QUOTE
I had to comment out line 179 to get it working, but other than that and win7 barfing up a security prompt for the sql database it's great so far, thanks!


For me the same
Go to the top of the page
+Quote Post
marc2003
post Feb 14 2010, 02:39
Post #212





Group: Members
Posts: 4464
Joined: 27-January 05
From: England
Member No.: 19379



you having problems with line 179 as well? or just the security warning?
Go to the top of the page
+Quote Post
dalover
post Feb 14 2010, 02:41
Post #213





Group: Members
Posts: 16
Joined: 8-February 10
Member No.: 77990



QUOTE (marc2003 @ Feb 14 2010, 02:39) *
you having problems with line 179 as well? or just the security warning?


Sorry for the missing detail - i have only line 179

CODE
[02:41:55] Error: WSH Panel Mod (GUID: E7B1F570-46AE-4C3D-A37D-6E7368F38B6F): Laufzeitfehler in Microsoft JScript:
Objekt erwartet
Ln: 179, Col: 2
Go to the top of the page
+Quote Post
Hitchhiker427
post Feb 14 2010, 02:43
Post #214





Group: Members
Posts: 232
Joined: 11-December 09
Member No.: 75848



I can't speak for/against the line 179 issue because I removed it (and changed a few other parts to suit my theme) before even trying the new version.
Go to the top of the page
+Quote Post
marc2003
post Feb 14 2010, 02:45
Post #215





Group: Members
Posts: 4464
Joined: 27-January 05
From: England
Member No.: 19379



i'm thinking perhaps you guys don't have the latest version of my scripts. download the full package from the opening post in this thread and extract just the scripts folder into your foobar program directory. over write any files if you're prompted. restart foobar if it's running.

This post has been edited by marc2003: Feb 14 2010, 02:45
Go to the top of the page
+Quote Post
dalover
post Feb 14 2010, 02:54
Post #216





Group: Members
Posts: 16
Joined: 8-February 10
Member No.: 77990



U are right wub.gif I updated the script folder and the error has disappeared
Go to the top of the page
+Quote Post
marc2003
post Feb 14 2010, 04:07
Post #217





Group: Members
Posts: 4464
Joined: 27-January 05
From: England
Member No.: 19379



another beta uploaded - click me

existing beta users can just import the new .txt file

@Hitchhiker427, you won't like this update because there is a possibility of the script running 3 context menu commands at the same time. it's the only way i can reliably update the playcount for tracks that are already loved. i have to remove existing records for both playcount and loved status otherwise i sometimes get database locked errors.

This post has been edited by marc2003: Feb 14 2010, 04:14
Go to the top of the page
+Quote Post
Hitchhiker427
post Feb 14 2010, 04:59
Post #218





Group: Members
Posts: 232
Joined: 11-December 09
Member No.: 75848



Hmm... I see. So, what disadvantages does the previous version have that this latest version addresses?

Additionally, is it possible to use the sqlite3.exe to delete values in the customdb_sqlite.db and change the loved status? In fact, it would be perfect (not sure if it's possible) to modify the .db file using ONLY the sqlite3.exe and not ever having to use the context menu controls. That would both speed things up and clean out the context menu.
Go to the top of the page
+Quote Post
n0obie4life
post Feb 14 2010, 07:22
Post #219





Group: Developer
Posts: 151
Joined: 24-April 07
From: Singapore
Member No.: 42842



Another piece of code to contribute here smile.gif


I have a few artists whom I tagged as say "Beyonce", however last.fm aliases "Beyonce" to "Beyoncé".
The current script calls the API to look for "Beyonce" and last.fm does not take into account this alias on the API's side; hence via the API, the script does not detect any playcounts properly.
The API at this point of time does not provide any form indication what artist it's aliased to.

I threw up a fix that detects if the "+noredirect" string is in the URL, then look for similar artists and assumes that the first result is the "correct" artist. This works most of the time - of course there are exceptional cases, but I think this is the furthest we can go, can't possibly be searching through every single result there tongue.gif


Code modification done is as follows:

In the process() function:
Add right at the top of the function
CODE
    try {
        var re = new RegExp("\\+noredirect");
        if ( re.test(xmlDoc) ) {
            similar();
            return;
        }
    } catch(e) { }


Add a new function called similar()

CODE
function similar() {
    fb.trace("Playcount sync: Finding similiar artists...");
    lastfm("&method=artist.getsimilar&limit=1&artist=" + encodeURIComponent(artist), "foo_playcount_sync", function() {
        xmlDoc = xmlhttp.responseText;
        var re = new RegExp("<name>(.*)</name>");
        var m = re.exec(xmlDoc);
        artist = m[1];
        sync();
    });
}



Cheers smile.gif

This post has been edited by n0obie4life: Feb 14 2010, 07:55


--------------------
:)
Go to the top of the page
+Quote Post
marc2003
post Feb 14 2010, 11:47
Post #220





Group: Members
Posts: 4464
Joined: 27-January 05
From: England
Member No.: 19379



@Hitchhiker427, i already explained in my post why i have to use the context menu commands. if i don't, sqlite fails. it's as simple as that. and given that nobody else has reported issues with the original script that runs 6 commands at once, i'm not too bothered about this version running up to 3.

if a track isn't loved, it runs just 1 command to delete the playcount and then sqlite runs to update the new one
if you've just loved a track for the first time, then it runs 2 commands (1 to delete the playcount, sqlite runs and then 1 to update the loved status)
if you're just playing a track that is already loved, then it runs 3 commands, 1 to delete playcount, 1 to delete the loved status and then another to set the loved status again after sqlite has run.

no way around it i'm afraid. i've messed around using sqlite syntax such as DELETE FROM and INSERT OR REPLACE and it always fails with "database locked" errors when records exist.

@noobie4life, i turn off spelling correction in the website options. so that means i get +noredirect in many of my reponses because i refuse to change my tags when i know they are correct and last.fm are wrong. this way, my results always match my scrobbles.

This post has been edited by marc2003: Feb 14 2010, 11:52
Go to the top of the page
+Quote Post
marc2003
post Feb 14 2010, 12:57
Post #221





Group: Members
Posts: 4464
Joined: 27-January 05
From: England
Member No.: 19379



new main version uploaded

-the rather large change is the liberation of the legacy commands (unsorted) context menu for existing foo_customdb users. it now contains just 4 entries for my script. there is a separate pdf file included explaining what has to be done to use this new script.
-new users should read the full readme.pdf included.

This post has been edited by marc2003: Feb 14 2010, 13:00
Go to the top of the page
+Quote Post
n0obie4life
post Feb 14 2010, 16:38
Post #222





Group: Developer
Posts: 151
Joined: 24-April 07
From: Singapore
Member No.: 42842



QUOTE (marc2003 @ Feb 14 2010, 18:47) *
@noobie4life, i turn off spelling correction in the website options. so that means i get +noredirect in many of my reponses because i refuse to change my tags when i know they are correct and last.fm are wrong. this way, my results always match my scrobbles.


Oh, I didn't know LFM takes into account your settings when it uses the API...it doesn't make sense to me anyhow.

Anyhow, if there are any users who listen to chinese songs and use this plugin, they may well be affected - traditional and simplified chinese are both correct, however lfm takes only the traditional chinese version. So the additional code could prove to be useful smile.gif

---

May I ask though, why the need for this code in the latest version?
CODE
if(fb.IsPlaying) { fb.Pause(); fb.Play(); }


This post has been edited by n0obie4life: Feb 14 2010, 18:11


--------------------
:)
Go to the top of the page
+Quote Post
Hitchhiker427
post Feb 14 2010, 19:18
Post #223





Group: Members
Posts: 232
Joined: 11-December 09
Member No.: 75848



@marc2003, Ok, I understand. I just tried out the newest main version, and the problem is almost unnoticeable anyhow. Thanks for all of your hard work.
Go to the top of the page
+Quote Post
marc2003
post Feb 14 2010, 23:06
Post #224





Group: Members
Posts: 4464
Joined: 27-January 05
From: England
Member No.: 19379



QUOTE (n0obie4life @ Feb 14 2010, 15:38) *
May I ask though, why the need for this code in the latest version?
CODE
if(fb.IsPlaying) { fb.Pause(); fb.Play(); }


it's a filthy hack to force the playlist to update instantly. because i'm updating foo_customdb externally, foobar doesn't always recognise that changes have been made so i have to give it a little nudge. the main thing is, it's totally invisible/inaudible to the end user.

This post has been edited by marc2003: Feb 14 2010, 23:07
Go to the top of the page
+Quote Post
n0obie4life
post Feb 15 2010, 18:33
Post #225





Group: Developer
Posts: 151
Joined: 24-April 07
From: Singapore
Member No.: 42842



QUOTE (marc2003 @ Feb 15 2010, 06:06) *
QUOTE (n0obie4life @ Feb 14 2010, 15:38) *
May I ask though, why the need for this code in the latest version?
CODE
if(fb.IsPlaying) { fb.Pause(); fb.Play(); }


it's a filthy hack to force the playlist to update instantly. because i'm updating foo_customdb externally, foobar doesn't always recognise that changes have been made so i have to give it a little nudge. the main thing is, it's totally invisible/inaudible to the end user.


Ah right okay, thanks.


--------------------
:)
Go to the top of the page
+Quote Post

41 Pages V  « < 7 8 9 10 11 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 17th September 2014 - 06:41