Image 01
profile-image

esdaniel1

Ed Daniel Paris, France
Amarok 2.x Scripts
Amarok2LibreFM

Amarok 2.x Scripts 29 comments

Score 53.3%
Sep 24 2010
#1 I checked the lastfmsubmitd code and as long as you use the server url parameter there will be no need to hack /etc/hosts as of lastfmsubmitd version: 1.05.

#2 I checked the Amarok2 code to see what urls they were communicating with... http://gitweb.kde.org/amarok/amarok.git?a=search&h=HEAD&st=grep&s=scrobble

My suggestion is that you should try and see what is taking place with Amarok by running it in debug mode (launch amarok from shell: <your shell prompt>amarok -d) to see what errors may be occurring with the LastFM scrobble then paste that info in a post here.

HTH

ed.
- Sep 24 2010
Indulge me, please let me know the ip address when you ping these two:

a) turtle.libre.fm
b) post.audioscrobbler.com

Are they the same IP address? - Sep 22 2010
Regrettably I think the issue is down to the fact 'we' use /etc/hosts to direct output to turtle.libre.fm instead of post.audioscrobbler.com.

One option is to run a second daemon and modify the parameters used. You might like to download lastfmsubmitd source (http://www.red-bean.com/decklin/lastfmsubmitd/) and hack this yourself - line 28 of the file lastfmsubmitd (SERVER_URL = ). It's not so tough, the daemon is in python so no code to compile - just ensure you think about potential conflicts with lastfmsubmitd daemon and make the necessary changes. There's a setup script in source to help with install as well. A better approach is to run one daemon that takes a parameter specifying where to scrobble.

I suppose 'we' really should fork lastfmsubmitd so librefm has it's own dedicated daemon or better I think to encourage the daemon coder to create multiconfig for different scrobblers - submitting a patch to the coder is probably the most polite approach. - Sep 22 2010
Hard to say - I have to make some assumptions...

#1 You're not using Amarok's inbuilt LastFM scrobbling

#2 You've only configured a single Lastfmsubmitd daemon, with your LibreFM info and using the Amarok2LibreFM script

If you've answered 'yes' to both those then as long as there is not some other wonderful weirdness going on then you will just be scrobbling to LibreFM.

If you enable #1 then you should have both though I've not checked that myself, Shane's your man for that:
http://amarok.kde.org/blog/archives/568-Last.fm-support-in-Amarok-2.html

HTH

ed. - Sep 21 2010
Lastfmsubmitd includes a sample client that connects to MPD (music player daemon):
http://www.red-bean.com/decklin/lastfmsubmitd/

You've got a configuration issue with respect to MPD based on the log info you've shared thus far. - Sep 14 2010
Thanks for the pointer, I've updated the download. - Apr 07 2010
main.js in this location:

~/.kde/share/apps/amarok/scripts/Amarok2LibreFM - Feb 06 2010
Sorry for the delay in getting this done - if you edit the main.js in ~/.kde/share/apps/amarok/scripts and replace the old function with this one it should do the trick...

function onTrackChange() {
if (config["showChange"]) {
var currentTrack = Amarok.Engine.currentTrack();
var wait_to_update = currentTrack.length * 0.33; // i.e. wait 33% of track length played before updating (in milliseconds)
var qo = new QObject();
qo.event = function(qevent) {
if (currentTrack.path == Amarok.Engine.currentTrack().path) {
notify();
}
this.killTimer(qo.timerID);
}
qo.timerID = qo.startTimer(wait_to_update);
}
}

I'll update the script in due course but let me know if that works for you. - Feb 06 2010
Sorry for late reply - just took a peek at the console debug output - thanks btw for posting that.

So the info that helps me trace is here:

"11:56:07 Error: Unable to import qt.core: no such extension on Line: 14"

This refers to the includes in the companion script that provides the on/off toggle for the script being enabled:

Importer.loadQtBinding( "qt.core");
Importer.loadQtBinding( "qt.gui");
Importer.loadQtBinding( "qt.uitools" );

You should check that you've got those libs installed - I think the key package you're looking for is libqt4-scripttools.

HTH

ed (esdaniel)
- Sep 09 2009
Thanks, Raycosm.

Script name updated so that Amarok's file extension filter matches.

FYI:

I use v 0.37-3 of the lastfmsubmit daemon from the repos, in the 'readme' I provide further instruction on how to use the daemon including configuring the daemon to use the LibreFM scrobbling url (turtle).

A daemon restart does not in and of itself dictate a system restart and as such you are able to restart your daemon without any need to restart, logout or perform any other action than have Amarok running with the script installed - the lastfmsubmit daemon is written with good intent, for example it has the ability to cache when it is unable to connect to the service and upload when the service is available again.

One thing I have been mulling over is the best way to reduce false positives such as duplicates because you restart a track - most seem to use a sleep function but I've not decided what I'll do and that feature will come in the next version.

- Jul 02 2009
Tip:

You might find in order for this to work that you will need to set permissions so that lastfmsubmit script, when called with your user account credz, can write to the work folders:

/var/log/lastfm/
/var/spool/lastfm/ - Jun 24 2009
ShowImage

Graphic Apps
by mkoller

Score 78.6%
May 15 2013
Choqok

Browser
by mtux

Score 83.3%
Dec 31 2010