First off DO NOT use the attached script unless you are running svn 15222 or higher.<br><br>Second you will need to run the following SQL to set the correct submittion settings <br>for MythMusic (replace the HOSTNAME part)...
<br><br>INSERT INTO settings (value,data,hostname) VALUE('MusicLastPlayDelay', '240', 'HOSTNAME');<br><br>This is so that songs do not get marked as played unless they have been playing for<br>at least 240 seconds or half their length, whichever comes first. It's important to do the
<br>above as those rules are set by <a href="http://last.fm/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">last.fm</a> and if you break them then the script could get <br>banned.<br><br>On my machine I've set the script to run every 5mins in a cronjob but before it's run for
<br>the first time you'll need to...<br><br>1) Change these lines to the relevant username/password for <a href="http://last.fm/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">last.fm</a> and mysql
<br>my $lastfmuser = 'USERNAME';<br>my $lastfmpass = 'PASSWORD';
<br>my $dbuser = 'mythtv';<br>my $dbpass = 'mythtv';<br><br>2) Run this line in the same folder as the script to create a "lastrun" file.<br>date +%s > lastrun<br><br>It will stick the current time in the file, then everything you play in mythmusic from now
<br>on will get submitted.<br><br>For testing you can also run the script as...<br>./mythlastfm.pl debug<br>...and it will output some debug status messages.<br><br>Please let us know if you have any suggestions/improvements.
<br><br>Thanks,<br>Ash<br>