summaryrefslogtreecommitdiff
path: root/plugins/lastfm
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-20 15:47:59 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-20 15:47:59 +0100
commit8c8d895ac93955731378eae3cea8d4abd223ada9 (patch)
tree612cdcf28d49915f5b0ad0d320305a8f5998cabb /plugins/lastfm
parentd7135eabfcfa726580e74d3c3e5c4ad8372c21d1 (diff)
added custom scrobbler url option to lastfm plugin
Diffstat (limited to 'plugins/lastfm')
-rw-r--r--plugins/lastfm/lastfm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/lastfm/lastfm.c b/plugins/lastfm/lastfm.c
index 40b42adf..20da6d8a 100644
--- a/plugins/lastfm/lastfm.c
+++ b/plugins/lastfm/lastfm.c
@@ -34,7 +34,8 @@ static DB_misc_t plugin;
static DB_functions_t *deadbeef;
#define LFM_CLIENTID "ddb"
-#define SCROBBLER_URL_V1 "http://post.audioscrobbler.com"
+#define SCROBBLER_URL_LFM "http://post.audioscrobbler.com"
+#define SCROBBLER_URL_LIBRE "http://turtle.libre.fm"
static char lfm_user[100];
static char lfm_pass[100];
@@ -178,10 +179,11 @@ auth (void) {
deadbeef->md5 (sig, token, strlen (token));
deadbeef->md5_to_str (token, sig);
+ const char *scrobbler_url = deadbeef->conf_get_str ("lastfm.scrobbler_url", SCROBBLER_URL_LFM);
#if LFM_TESTMODE
- snprintf (req, sizeof (req), "%s/?hs=true&p=1.2.1&c=tst&v=1.0&u=%s&t=%d&a=%s", SCROBBLER_URL_V1, lfm_user, timestamp, token);
+ snprintf (req, sizeof (req), "%s/?hs=true&p=1.2.1&c=tst&v=1.0&u=%s&t=%d&a=%s", scrobbler_url, lfm_user, timestamp, token);
#else
- snprintf (req, sizeof (req), "%s/?hs=true&p=1.2.1&c=%s&v=%d.%d&u=%s&t=%d&a=%s", SCROBBLER_URL_V1, LFM_CLIENTID, plugin.plugin.version_major, plugin.plugin.version_minor, lfm_user, timestamp, token);
+ snprintf (req, sizeof (req), "%s/?hs=true&p=1.2.1&c=%s&v=%d.%d&u=%s&t=%d&a=%s", scrobbler_url, LFM_CLIENTID, plugin.plugin.version_major, plugin.plugin.version_minor, lfm_user, timestamp, token);
#endif
// handshake
int status = curl_req_send (req, NULL);
@@ -788,6 +790,7 @@ lastfm_stop (void) {
static const char settings_dlg[] =
"property Username entry lastfm.login \"\";\n"
"property Password password lastfm.password \"\";"
+ "property \"Scrobble URL\" entry lastfm.scrobbler_url \""SCROBBLER_URL_LFM"\";"
;
// define plugin interface