Hi,

Here is a simple patch (based on the latest mercurial pull of
lastfmsubmitd... which is strangely still marked as 1.0.3..).
It's very trivial and will apply the same on debian's 1.0.4, which I
believe are identical.

It allows the user to add the field 
server = http://post.to.whatever
in her/his lastfmsubmitd.conf

a. 
# HG changeset patch
# User Aymeric Mansoux <ayme...@goto10.org>
# Date 1239402819 -7200
# Node ID bd5d01ad3b2d21e8e8d200d8a8f764a5ccf765e9
# Parent  2816bb7cf350824e4e2ef9e4d5f28fbc2a5eddf9
support for alternative server

diff -r 2816bb7cf350 -r bd5d01ad3b2d lastfmsubmitd
--- a/lastfmsubmitd	Sat Feb 14 16:54:52 2009 -0500
+++ b/lastfmsubmitd	Sat Apr 11 00:33:39 2009 +0200
@@ -19,10 +19,9 @@
     DAEMON_NAME
 
 CLIENT_ID = 'lsd'
-CLIENT_VERSION = '1.0.3'
+CLIENT_VERSION = '1.0.4'
 
 PROTOCOL_VERSION = '1.1'
-HANDSHAKE_URL_BASE = 'http://post.audioscrobbler.com/'
 SUB_CHUNK_SIZE = 10
 DEF_INTERVAL = 1
 
@@ -139,7 +138,7 @@
             'v': CLIENT_VERSION,
             'u': self.cli.conf.user,
             }
-        return '?'.join([HANDSHAKE_URL_BASE, urllib.urlencode(args)])
+        return '?'.join([self.cli.conf.server + '/', urllib.urlencode(args)])
 
     def handshake(self):
         self.cli.log.debug('Handshake URL: %s' % self.handshake_url)
@@ -262,6 +261,7 @@
 class LsdConfig(lastfm.config.Config):
     def __init__(self):
         lastfm.config.Config.__init__(self, name=DAEMON_NAME)
+        self.server = self.cp.get('account', 'server', None)
         self.user = self.cp.get('account', 'user', None)
         self.password = self.cp.get('account', 'password', None)
         if not (self.user and self.password):

Reply via email to